DelegateMQ
|
#include <cstdint>
#include <stddef.h>
Go to the source code of this file.
Functions | |
void | xalloc_init () |
void | xalloc_destroy () |
void * | xmalloc (size_t size) |
void | xfree (void *ptr) |
void * | xrealloc (void *ptr, size_t size) |
void | xalloc_stats () |
Output allocator statistics to the standard output. | |
void xalloc_destroy | ( | ) |
This function must be called once when the application exits. Never call xalloc_destroy() manually except if using xallocator in a C-only application. If using xallocator exclusively in C files within your application code, you must call this function before the program exits. If using C++, ~XallocInitDestroy() must call xalloc_destroy automatically. Embedded systems that never exit need not call this function at all.
Called one time when the application exits to cleanup any allocated memory. ~XallocInitDestroy destructor calls this function automatically.
void xalloc_init | ( | ) |
This function must be called exactly one time before the operating system threading starts. If using xallocator exclusively in C files within your application code, you must call this function before the OS starts. If using C++, client code does not call xalloc_init. Let XallocInitDestroy() call xalloc_init automatically. Embedded systems that never exit can call xalloc_init() manually at startup and eliminate XallocInitDestroy usage. When the system is still single threaded at startup, the xallocator API does not need mutex protection.
This function must be called exactly one time before any other xallocator API is called. XallocInitDestroy constructor calls this function automatically.
void xalloc_stats | ( | ) |
Output allocator statistics to the standard output.
Output allocator statistics to the standard output.
void xfree | ( | void * | ptr | ) |
Frees a previously xalloc allocated block
[in] | ptr | - a pointer to a previously allocated memory using xalloc. |
Frees a memory block previously allocated with xalloc. The blocks are returned to the fixed block allocator that originally created it.
[in] | ptr | - a pointer to a block created with xalloc. |
void * xmalloc | ( | size_t | size | ) |
Allocate a block of memory
[in] | size | - the size of the block to allocate. |
Allocates a memory block of the requested size. The blocks are created from the fixed block allocators.
[in] | size | - the client requested size of the block. |
void * xrealloc | ( | void * | oldMem, |
size_t | size ) |
Reallocates an existing xalloc block to a new size
[in] | ptr | - a pointer to a previously allocated memory using xalloc. |
[in] | size | - the size of the new block |
Reallocates a memory block previously allocated with xalloc.
[in] | ptr | - a pointer to a block created with xalloc. |
[in] | size | - the client requested block size to create. |