CX Framework
Cross-platform C utility framework
Loading...
Searching...
No Matches
Compatibility Interface

Functions

void * xa_malloc (size_t size)
 malloc-compatible allocation function
 
void * xa_calloc (size_t number, size_t size)
 calloc-compatible allocation function
 
void * xa_realloc (void *ptr, size_t size)
 realloc-compatible allocation function
 
void xa_free (void *ptr)
 free-compatible deallocation function
 
char * xa_strdup (const char *src)
 strdup-compatible string duplication function
 

Detailed Description

Standard C malloc/free compatible interface for use with third-party libraries.

Normally the compatibility interface uses optional allocations to emulate the behavior of malloc() returning NULL when out of memory. Some applications may not wish to do that and would rather assert and/or install an XA_Fatal handler.

These applications can define XALLOC_COMPAT_REQUIRE before including xalloc.h to force the interface to use required allocations instead.