Inlined definitions for onstant size allocation and freeing. More...
Functions | |
| void * | mi_malloc_csize (size_t size) |
| Allocate a constant size object. | |
| void * | mi_zalloc_csize (size_t size) |
| void * | mi_theap_malloc_csize (mi_theap_t *theap, size_t size) |
| void * | mi_theap_zalloc_csize (mi_theap_t *theap, size_t size) |
| void | mi_free_csize (void *p, size_t size) |
| Free a pointer with a known constant size. | |
| void | mi_free_csize_nonnull (void *p, size_t size) |
| Free a non-null pointer with a known constant size. | |
Inlined definitions for onstant size allocation and freeing.
If the size is constant, it can pick statically between mi_malloc() and mi_malloc_small(). For example:
On v3 these can improve performance. This is especially useful for compilers and runtimes where the the size is often statically known. These functions can be used even when the size is not constant but then there is no performance benefit.
| void mi_free_csize | ( | void * | p, |
| size_t | size ) |
Free a pointer with a known constant size.
| p | The pointer to the allocated block (or NULL ) |
| size | The size with which the pointer was allocated. |
| void mi_free_csize_nonnull | ( | void * | p, |
| size_t | size ) |
Free a non-null pointer with a known constant size.
| p | The pointer to the allocated block (cannot be NULL !) |
| size | The size with which the pointer was allocated. |
| void * mi_malloc_csize | ( | size_t | size | ) |
Allocate a constant size object.
| size | A (compile-time) constant size. |
| void * mi_theap_malloc_csize | ( | mi_theap_t * | theap, |
| size_t | size ) |
| void * mi_theap_zalloc_csize | ( | mi_theap_t * | theap, |
| size_t | size ) |
| void * mi_zalloc_csize | ( | size_t | size | ) |