Zen API

- Home
- Help Topics
- Types by Category
- All Types
- Files

All Classes Files Functions Variables Typedefs Macros Groups Pages
kUserAlloc.h
Go to the documentation of this file.
1 /**
2 * @file kUserAlloc.h
3 * @brief Declares the kUserAlloc class.
4 *
5 * @internal
6 * Copyright (C) 2005-2014 by LMI Technologies Inc.
7 * Licensed under the MIT License.
8 * Redistributed files must retain the above copyright notice.
9 */
10 #ifndef K_API_USER_ALLOC_H
11 #define K_API_USER_ALLOC_H
12
13 #include <kApi/kApiDef.h>
14
15 kBeginHeader()
16
17 /**
18 * @class kUserAlloc
19 * @extends kAlloc
20 * @ingroup kApi
21 * @brief Allocates memory from a user-defined memory source.
22 */
23 //typedef kAlloc kUserAlloc; --forward-declared in kApiDef.x.h
24
25 /**
26 * Constructs a new kUserAlloc instance.
27 *
28 * @public @memberof kUserAlloc
29 * @param object Receives the constructed kUserAlloc instance.
30 * @param allocFx User-defined memory allocation function.
31 * @param freeFx User-defined memory free function.
32 * @param provider User-defined context pointer.
33 * @param allocator Memory allocator for this object instance (or kNULL for default).
34 * @return Operation status.
35 */
36 kFx(kStatus) kUserAlloc_Construct(kUserAlloc* object, kApiMemAllocFx allocFx, kApiMemFreeFx freeFx, kPointer provider, kAlloc allocator);
37
38 /**
39 * Gets provider handle passed to kUserAlloc constructor.
40 *
41 * @public @memberof kUserAlloc
42 * @param object kUserAlloc instance.
43 * @return User-defined context pointer.
44 */
45 kFx(kPointer) kUserAlloc_Provider(kUserAlloc object);
46
47 kEndHeader()
48
49 #include <kApi/Utils/kUserAlloc.x.h>
50
51 #endif
kUserAlloc::kUserAlloc_Construct
kStatus kUserAlloc_Construct(kUserAlloc *object, kApiMemAllocFx allocFx, kApiMemFreeFx freeFx, kPointer provider, kAlloc allocator)
Constructs a new kUserAlloc instance.
kPointer
Represents a void pointer.
kAlloc
Abstract base class for memory allocator types.
kApiMemAllocFx
kStatus(kCall * kApiMemAllocFx)(kPointer provider, kSize size, void *mem)
Function signature for memory allocation handler.
Definition: kApiLib.h:18
kUserAlloc::kUserAlloc_Provider
kPointer kUserAlloc_Provider(kUserAlloc object)
Gets provider handle passed to kUserAlloc constructor.
kUserAlloc
Allocates memory from a user-defined memory source.
kApiMemFreeFx
kStatus(kCall * kApiMemFreeFx)(kPointer provider, void *mem)
Function signature for memory free handler.
Definition: kApiLib.h:21
kApiDef.h
Essential API declarations.
kStatus
Represents an enumeration of error codes.