CSSM_SPI_MEMORY_FUNCS

This structure is used by OCSF to pass an application's memory function table to the service provider modules. The functions are used when memory needs to be allocated by the service provider module for returning data structures to the applications.

typedef struct cssm_spi_func_tbl {
void *(*malloc_func) (CSSM_HANDLE AddInHandle, uint32 Size);
void (*free_func) (CSSM_HANDLE AddInHandle, void *MemPtr);
void  *(*realloc_func) (CSSM_HANDLE AddInHandle, void *MemPtr, uint32 Size);
void  *(*calloc_func) (CSSM_HANDLE AddInHandle, uint32 Num, uint32 Size);
} CSSM_SPI_MEMORY_FUNCS, *CSSM_SPI_MEMORY_FUNCS_PTR;

Definitions:

Malloc_func
Pointer to function that returns a void pointer to the allocated memory block of at least size bytes from heap AllocRef.
Free_func
Pointer to function that deallocates a previously allocated memory block (memblock) from heap AllocRef.
Realloc_func
Pointer to function that returns a void pointer to the reallocated memory block (memblock) of at least size bytes from heap AllocRef.
Calloc_func
Pointer to function that returns a void pointer to an array of num elements of length size initialized to zero from heap AllocRef.
AllocRef
Pointer that can be used at the discretion of the application developer to implement additional memory management features such as usage counters.