Zen API
 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 
45 {
46  xkUserAlloc_Cast(object)->base.traits |= traits;
47 }
48 
57 {
58  xkUserAlloc_Cast(object)->base.traits &= ~traits;
59 }
60 
69 
70 #endif
kStatus(kCall * kApiMemFreeFx)(kPointer provider, void *mem)
Function signature for memory free handler.
Definition: kApiLib.h:25
Represents a void pointer.
Abstract base class for memory allocator types.
#define kInlineFx(TYPE)
Inline method declaration helper.
Definition: kApiDef.h:26
kPointer kUserAlloc_Provider(kUserAlloc object)
Gets provider handle passed to kUserAlloc constructor.
Allocates memory from a user-defined memory source.
kStatus(kCall * kApiMemAllocFx)(kPointer provider, kSize size, void *mem, kMemoryAlignment alignment)
Function signature for memory allocation handler.
Definition: kApiLib.h:19
Core Zen type declarations.
void kUserAlloc_AddTraits(kUserAlloc object, kAllocTrait traits)
Adds traits reported by the allocator.
Definition: kUserAlloc.h:44
kStatus kUserAlloc_Construct(kUserAlloc *object, kApiMemAllocFx allocFx, kApiMemFreeFx freeFx, kPointer provider, kAlloc allocator)
Constructs a new kUserAlloc instance.
Represents an error code.
void kUserAlloc_RemoveTraits(kUserAlloc object, kAllocTrait traits)
Removes traits reported by the allocator.
Definition: kUserAlloc.h:56
Represents a memory allocator trait.