Applications will register memory functions with the add-in modules during attach time and with CSSM during initialization. A memory function table will be passed from the application to add-in modules through the CSSM_xxx_Attach functions associated with each add-in. The CSSM_Init function is where the CSSM will receive the application's memory function.
typedef struct cssm_api_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_API_MEMORY_FUNCS, *CSSM_API_MEMORY_FUNCS_PTR
Contents | Next section | Index |