|
cbase 1.50.0
C/C++ Static Template
|
Dylan Falconer-style typed allocation macros. No casts, no sizeof. More...
Macros | |
| #define | MAKE(type, count, alloc) |
Allocates and zero-initialises an array of count elements of type. | |
| #define | MAKE_STRUCT(type, alloc) |
Allocates and zero-initialises a single instance of type. | |
| #define | RELEASE(type, count, ptr, alloc) |
| Frees a previously allocated block through the allocator. | |
Dylan Falconer-style typed allocation macros. No casts, no sizeof.
| #define MAKE | ( | type, | |
| count, | |||
| alloc ) |
Allocates and zero-initialises an array of count elements of type.
Example:
| type | The element type. |
| count | Number of elements. |
| alloc | Pointer to a MemAllocator. |
Definition at line 208 of file mem_allocator.h.
| #define MAKE_STRUCT | ( | type, | |
| alloc ) |
Allocates and zero-initialises a single instance of type.
Example:
| type | The struct type to allocate. |
| alloc | Pointer to a MemAllocator. |
Definition at line 223 of file mem_allocator.h.
| #define RELEASE | ( | type, | |
| count, | |||
| ptr, | |||
| alloc ) |
Frees a previously allocated block through the allocator.
For arena allocators this is a no-op. For heap allocators it calls free.
| type | The element type (used to compute the size). |
| count | Number of elements originally allocated. |
| ptr | Pointer to the allocation. |
| alloc | Pointer to the MemAllocator. |
Definition at line 235 of file mem_allocator.h.