Sets memory allocation functions
dip_Error dip_MemoryFunctionsSet( MemoryNewFunction, MemoryReallocateFunction, MemoryFreeFunction )
Sets the memory allocation functions used by DIPlib.
Data type | Name | Description |
dip_MemoryNewFunction | MemoryNewFunction | pointer to a memory allocation function |
dip_MemoryReallocateFunction | MemoryReallocateFunction | pointer to a memory reallocation function |
dip_MemoryFreeFunction | MemoryFreeFunction | pointer to a memory freeing function |
The three allocation functions are defined as follows:
typedef void* (*dip_MemoryNewFunction)(size_t size)
typedef void* (*dip_MemoryReallocateFunction)(void *ptr, size_t size)
typedef void (*dip_MemoryFreeFunction)(void *ptr)
And are by default set to malloc, realloc and free.