#include <stddef.h>
Go to the source code of this file.
◆ kl_allocator_default()
Return the default stdlib-backed allocator.
- Returns
- Allocator wrapping malloc/realloc/free.
◆ kl_malloc()
Allocate memory through the given allocator.
- Parameters
-
| a | Allocator to use. |
| size | Bytes to allocate. |
- Returns
- Pointer to allocated memory, or NULL on failure.
◆ kl_realloc()
| void * kl_realloc |
( |
KlAllocator * |
a, |
|
|
void * |
ptr, |
|
|
size_t |
old_size, |
|
|
size_t |
new_size |
|
) |
| |
Reallocate memory through the given allocator.
- Parameters
-
| a | Allocator to use. |
| ptr | Existing allocation (may be NULL). |
| old_size | Previous allocation size. |
| new_size | Desired new size. |
- Returns
- Pointer to reallocated memory, or NULL on failure.
◆ kl_free()
| void kl_free |
( |
KlAllocator * |
a, |
|
|
void * |
ptr, |
|
|
size_t |
size |
|
) |
| |
Free memory through the given allocator.
- Parameters
-
| a | Allocator to use. |
| ptr | Pointer to free. |
| size | Size of the allocation being freed. |