Functions | |
void | cx_memory_vtable_set (cx_memory_vtable *table) |
Install a new set of memory managmement functions. | |
cxptr | cx_malloc (cxsize nbytes) |
Allocate nbytes bytes. | |
cxptr | cx_malloc_clear (cxsize nbytes) |
Allocate nbytes bytes and clear them. | |
cxptr | cx_calloc (cxsize natoms, cxsize nbytes) |
Allocate memory for natoms elements of size size. | |
cxptr | cx_realloc (cxptr memory, cxsize nbytes) |
Change the size of a memory block. | |
void | cx_free (cxptr memory) |
Memory block deallocation. | |
cxbool | cx_memory_is_system_malloc (void) |
Check if the system's defaults are used for memory allocation. |
NULL
.
#include <cxmemory.h>
cxptr cx_calloc | ( | cxsize | natoms, | |
cxsize | nbytes | |||
) |
Allocate memory for natoms elements of size size.
natoms | Number of atomic elements. | |
nbytes | Element size in bytes. |
void cx_free | ( | cxptr | memory | ) |
Memory block deallocation.
cxptr cx_malloc | ( | cxsize | nbytes | ) |
Allocate nbytes bytes.
nbytes | Number of bytes. |
cxptr cx_malloc_clear | ( | cxsize | nbytes | ) |
Allocate nbytes bytes and clear them.
nbytes | Number of bytes. |
cxbool cx_memory_is_system_malloc | ( | void | ) |
Check if the system's defaults are used for memory allocation.
TRUE
if memory is allocated through the system's malloc() implementation, it not it returns FALSE
.
void cx_memory_vtable_set | ( | cx_memory_vtable * | table | ) |
Install a new set of memory managmement functions.
table | Set of memory management functions. |
cxptr cx_realloc | ( | cxptr | memory, | |
cxsize | nbytes | |||
) |
Change the size of a memory block.
memory | Number of atomic elements. | |
nbytes | New memory block size in bytes. |
NULL
the call to cx_realloc() is equivalent to cx_malloc(), and if nbytes is 0 the call is equivalent to cx_free(). Unless memory is NULL
, it must have been returned by a previous call to cx_malloc(), cx_malloc_clear(), cx_calloc(), or cx_realloc().