Zen API
 All Classes Files Functions Variables Typedefs Friends Macros Modules Pages
kDebugAlloc.h
Go to the documentation of this file.
1 
10 #ifndef K_API_DEBUG_ALLOC_H
11 #define K_API_DEBUG_ALLOC_H
12 
13 #include <kApi/kApiDef.h>
14 
15 kBeginHeader()
16 
17 
23 typedef struct kDebugAllocation
24 {
30 
37 //typedef kAlloc kDebugAlloc; --forward-declared in kApiDef.x.h
38 
48 kFx(kStatus) kDebugAlloc_Construct(kDebugAlloc* object, const kChar* name, kAlloc allocator);
49 
58 
67 
77 
89 kFx(kStatus) kDebugAlloc_Allocations(kDebugAlloc object, k64u since, kArrayList* history, kAlloc alloc);
90 
101 
115 
130 
143 kFx(kStatus) kDebugAlloc_SetAllocListener(kDebugAlloc object, kCallbackFx function, kPointer receiver);
144 
145 kEndHeader()
146 
147 #include <kApi/Utils/kDebugAlloc.x.h>
148 
149 #endif
kStatus kDebugAlloc_Allocations(kDebugAlloc object, k64u since, kArrayList *history, kAlloc alloc)
Gets a list of all outstanding memory allocations performed after the given checkpoint.
Represents a 64-bit unsigned integer.
kSize size
Size of memory allocation.
Definition: kDebugAlloc.h:26
kStatus kDebugAlloc_SetAllocListener(kDebugAlloc object, kCallbackFx function, kPointer receiver)
Registers a user-defined function that is called whenever a memory allocation occurs.
Represents a library of types.
Represents a void pointer.
k64u index
Incremented with each allocation.
Definition: kDebugAlloc.h:27
Debug memory allocator that can track allocations and report leaks.
Represents an unsigned integer that can store a pointer address.
Abstract base class for memory allocator types.
kSize kDebugAlloc_Allocated(kDebugAlloc object)
Returns the total amount of memory that has been allocated and not yet freed.
kByte * data
User data pointer.
Definition: kDebugAlloc.h:25
kStatus kDebugAlloc_DetectLeakedObjects(kDebugAlloc object, k64u since)
Makes note of outstanding allocations that appear to be objects from any currently-loaded assembly...
kArrayList trace
Backtrace at point of allocation – kArrayList.
Definition: kDebugAlloc.h:28
kStatus kDebugAlloc_Construct(kDebugAlloc *object, const kChar *name, kAlloc allocator)
Constructs a new kDebugAlloc allocator.
Represents a single unit (byte) in a UTF-8 character.
Represents a byte on the current platform.
kStatus kDebugAlloc_DetectLeakedAssemblyObjects(kDebugAlloc object, k64u since, kAssembly assembly)
Makes note of outstanding allocations that appear to be objects associated with the specified assembl...
Core Zen type declarations.
kStatus(kCall * kCallbackFx)(kPointer receiver, kPointer sender, void *args)
Callback signature for a generic event handler.
Definition: kApiDef.h:1450
Represents a list implemented with a dynamic array.
k64u kDebugAlloc_Checkpoint(kDebugAlloc object)
Returns a memory checkpoint value, used in conjunction with allocation logging functions.
Allocation record used by kDebugAlloc.
Definition: kDebugAlloc.h:23
Represents an error code.
kStatus kDebugAlloc_LogAllocations(kDebugAlloc object, k64u since)
Logs all outstanding memory allocations performed after the given checkpoint (using kLogf)...
kStatus kDebugAlloc_Clear(kDebugAlloc object)
Clears all outstanding allocations (resets allocator).