Zen API

- Home
- Topics
- Types
- Files

All Classes Files Functions Variables Typedefs Friends Macros Modules Pages
kUserAlloc.h
Go to the documentation of this file.
1
10 #ifndef K_API_USER_ALLOC_H
11 #define K_API_USER_ALLOC_H
12
13 #include <kApi/kApiDef.h>
14 #include <kApi/Utils/kUserAlloc.x.h>
15
22 //typedef kAlloc kUserAlloc; --forward-declared in kApiDef.x.h
23
35 kFx(kStatus) kUserAlloc_Construct(kUserAlloc* object, kApiMemAllocFx allocFx, kApiMemFreeFx freeFx, kPointer provider, kAlloc allocator);
36
46 kInlineFx(void) kUserAlloc_EnableForeignMemory(kUserAlloc object, kBool enable)
47 {
48 xkUserAlloc_Cast(object)->base.isForeign = enable;
49 }
50
60 kInlineFx(void) kUserAlloc_EnableObjectMemory(kUserAlloc object, kBool enable)
61 {
62 xkUserAlloc_Cast(object)->base.canGetObject = enable;
63 }
64
72 kFx(kPointer) kUserAlloc_Provider(kUserAlloc object);
73
74 #endif
kApiLib::kApiMemFreeFx
kStatus(kCall * kApiMemFreeFx)(kPointer provider, void *mem)
Function signature for memory free handler.
Definition: kApiLib.h:25
kUserAlloc::kUserAlloc_EnableForeignMemory
void kUserAlloc_EnableForeignMemory(kUserAlloc object, kBool enable)
Controls whether this allocator will report that it emits foreign memory.
Definition: kUserAlloc.h:46
kUserAlloc::kUserAlloc_EnableObjectMemory
void kUserAlloc_EnableObjectMemory(kUserAlloc object, kBool enable)
Controls whether this allocator will report that it is capable of allocating objects.
Definition: kUserAlloc.h:60
kApiLib::kApiMemAllocFx
kStatus(kCall * kApiMemAllocFx)(kPointer provider, kSize size, void *mem)
Function signature for memory allocation handler.
Definition: kApiLib.h:19
kPointer
Represents a void pointer.
kAlloc
Abstract base class for memory allocator types.
kInlineFx
#define kInlineFx(TYPE)
Inline method declaration helper.
Definition: kApiDef.h:26
kUserAlloc::kUserAlloc_Provider
kPointer kUserAlloc_Provider(kUserAlloc object)
Gets provider handle passed to kUserAlloc constructor.
kUserAlloc
Allocates memory from a user-defined memory source.
kApiDef.h
Core Zen type declarations.
kUserAlloc::kUserAlloc_Construct
kStatus kUserAlloc_Construct(kUserAlloc *object, kApiMemAllocFx allocFx, kApiMemFreeFx freeFx, kPointer provider, kAlloc allocator)
Constructs a new kUserAlloc instance.
kStatus
Represents an error code.
kBool
Represents a boolean value.