8 Oracle Key Vault Client SDK Memory Management APIs

This section describes the Oracle Key Vault interfaces required to handle endpoint specified memory management.

8.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 OKVMemoryCtx)

ptr

IN

Previously allocated memory

Return Values

No values returned.

Comments

None.

Related Topics

8.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

ctx

IN

Memory context of OKVMemoryCtx.

size

IN

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

8.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

IN

Memory context (context of OKVMemoryCtx).

ptr

IN

Previously allocated memory.

size

IN

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.

Related Topics