CSSM_MEMORY_FUNCS/ CSSM_API_MEMORY_FUNCS

This structure is used by applications to supply memory functions for the OCSF and the service provider modules. The functions are used when memory needs to be allocated by the OCSF or service providers for returning data structures to the applications.

typedef struct cssm_memory_funcs {
    void *(*malloc_func) (uint32 Size, void *AllocRef);
    void  (*free_func)   (void *MemPtr, void *AllocRef);
    void *(*realloc_func)(void *MemPtr, uint32 Size, void *AllocRef);
    void *(*calloc_func) (uint32 Num, uint32 Size, void *AllocRef);
    void *AllocRef;
} CSSM_MEMORY_FUNCS, *CSSM_MEMORY_FUNCS_PTR;

typedef CSSM_MEMORY_FUNCS CSSM_API_MEMORY_FUNCS;
typedef CSSM_API_MEMORY_FUNCS *CSSM_API_MEMORY_FUNCS_PTR; 

Definitions:

Malloc_func
Pointer to a function that returns a void pointer to the allocated memory block of at least Size bytes from heap AllocRef.
Free_func
Pointer to a function that deallocates a previously allocated memory block (MemPtr ) from heap AllocRef.
Realloc_func
Pointer to a function that returns a void pointer to the reallocated memory block (MemPtr) of at least Size bytes from heap AllocRef.
Calloc_func
Pointer to a function that returns a void pointer to an array of Num elements of length Size initialized to zero from heap AllocRef.
AllocRef
Indicates which memory heap the function operates on