Zen API
 All Classes Files Functions Variables Typedefs Friends Macros Modules Pages
kAlloc.h
Go to the documentation of this file.
1 
10 #include <kApi/kApiDef.h> //--inclusion order controlled by kApiDef
11 
12 #ifndef K_API_ALLOC_H
13 #define K_API_ALLOC_H
14 
15 kBeginHeader()
16 
17 
33 kFx(kStatus) kAlloc_Get(kAlloc alloc, kSize size, void* mem);
34 
44 kFx(kStatus) kAlloc_GetZero(kAlloc alloc, kSize size, void* mem);
45 
54 kFx(kStatus) kAlloc_Free(kAlloc alloc, void* mem);
55 
64 kFx(kStatus) kAlloc_FreeRef(kAlloc alloc, void* mem);
65 
75 kFx(kAlloc) kAlloc_App();
76 
88 kFx(kAlloc) kAlloc_System();
89 
97 kFx(kAlloc) kAlloc_Fallback(kAlloc alloc);
98 
100 #define kAlloc_Get_(ALLOC, SIZE, MEM) kxAlloc_Get_(ALLOC, SIZE, MEM)
101 #define kAlloc_GetZero_(ALLOC, SIZE, MEM) kxAlloc_GetZero_(ALLOC, SIZE, MEM)
102 #define kAlloc_Free_(ALLOC, MEM) kxAlloc_Free_(ALLOC, MEM)
103 #define kAlloc_FreeRef_(ALLOC, MEM) kxAlloc_FreeRef_(ALLOC, MEM)
104 #define kAlloc_App_() kxAlloc_App_()
105 #define kAlloc_System_() kxAlloc_System_()
106 #define kAlloc_Fallback_(ALLOC) kxAlloc_Fallback_(ALLOC)
107 
109 kEndHeader()
110 
111 #include <kApi/kAlloc.x.h>
112 
113 #endif
kAlloc kAlloc_Fallback(kAlloc alloc)
Returns the passed allocator, or if null, the App allocator.
kAlloc kAlloc_App()
Gets the allocator that should normally be used by applications to request memory.
Represents an unsigned integer that can store a pointer address.
Abstract base class for memory allocator types.
kStatus kAlloc_Free(kAlloc alloc, void *mem)
Frees a block of memory.
kAlloc kAlloc_System()
Gets the system allocator.
Core Zen type declarations.
kStatus kAlloc_FreeRef(kAlloc alloc, void *mem)
Frees a block of memory and sets the memory pointer to kNULL.
Represents an error code.
kStatus kAlloc_Get(kAlloc alloc, kSize size, void *mem)
Allocates a block of memory.
kStatus kAlloc_GetZero(kAlloc alloc, kSize size, void *mem)
Allocates a block of memory and zero-initializes the block.