9 Oracle Key Vault Client SDK Memory Management APIs
This section describes the Oracle Key Vault interfaces required to handle endpoint specified memory management.
- okvFree
okvFreeis a pointer to the endpoint program defined function to free the memory allocated usingokvMallocorokvRealloc. - okvMalloc
okvMallocis a pointer to the endpoint program defined function that should allocate memory. - okvRealloc
okvReallocis a pointer to the endpoint program defined function that should reallocate memory. 
Parent topic: Oracle Key Vault Client C SDK API Reference
9.1 okvFree
okvFree is a pointer to the endpoint program defined
        function to free the memory allocated using okvMalloc or
            okvRealloc.
                  
Category
Memory management API
Purpose
okvFree is a pointer to the endpoint program defined function to
                free the memory allocated using  okvMalloc or
                    okvRealloc. The pointer should be set to NULL after freeing
                it.
                     
Syntax
void (*okvFree)(void *ctx, void **ptr);
Parameters
| Parameter | IN/OUT | Description | 
|---|---|---|
ctx | 
                                 IN | 
                                 
                                     Memory context (context of   | 
                              
ptr | 
                                 
                                     
  | 
                                 
                                     Previously allocated memory  | 
                              
Return Values
No values returned.
Comments
None.
Related Topics
Parent topic: Oracle Key Vault Client SDK Memory Management APIs
9.2 okvMalloc
okvMalloc is a pointer to the endpoint program defined function that should allocate memory.
                  
Category
Memory management API
Purpose
okvMalloc is a pointer to the endpoint program defined function that should allocate memory.
                     
Syntax
void * (*okvMalloc)(void *ctx, size_t size);
Parameters
| Parameter | IN/OUT | Description | 
|---|---|---|
| 
                                     
  | 
                                 
                                     
  | 
                                 Memory context of OKVMemoryCtx.
                                  | 
                              
| 
                                     
  | 
                                 
                                     
  | 
                                 Size of memory to be allocated. | 
Return Values
| Return Value | Description | 
|---|---|
void* | 
                                 
                                     Memory pointer to allocated memory. Success: A valid pointer to the allocated memory is returned. Failure: A NULL pointer is returned if the function cannot allocate memory of requested size.  | 
                              
Comments
None.
Related Topics
Parent topic: Oracle Key Vault Client SDK Memory Management APIs
9.3 okvRealloc
okvRealloc is a pointer to the endpoint program defined function that should reallocate memory. 
                  
Category
Memory management API
Purpose
okvRealloc is a pointer to the endpoint program defined function
                that should reallocate memory. The data in the previously allocated memory should be
                copied to the newly allocated memory.
                     
Syntax
void * (*okvRealloc)(void *ctx, void **ptr, size_t size);
Parameters
| Parameter | IN/OUT | Description | 
|---|---|---|
ctx | 
                                 
                                     
  | 
                                 
                                     Memory context (context of   | 
                              
ptr | 
                                 
                                     
  | 
                                 
                                     Previously allocated memory.  | 
                              
size | 
                                 
                                     
  | 
                                 
                                     Size of the memory to be allocated.  | 
                              
Return Values
| Return Value | Description | 
|---|---|
void* | 
                                 
                                    
                                     Memory pointer to reallocated memory. Success: A valid pointer to the re-allocated memory is returned. Failure: A NULL pointer is returned if the function cannot allocate memory of requested size.  | 
                              
Comments
None.
Parent topic: Oracle Key Vault Client SDK Memory Management APIs