z/OS Open Cryptographic Services Facility Application Programming
Previous topic | Next topic | Contents | Index | Contact z/OS | Library | PDF


CSSM_MEMORY_FUNCS and CSSM_API_MEMORY_FUNCS

z/OS Open Cryptographic Services Facility Application Programming
SC24-5899-01

This structure is used by applications to supply memory functions for OCSF and the service provider modules. The functions are used when memory needs to be allocated by OCSF or service provider modules 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 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.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014