Harlequin RIP SDK
Common code for all CMM examples

The CMM examples share functions to call the sw_memory_api callback API provided by the RIP for allocation and deallocation. More...

Files

file  cmm_common.c
 Code common to all CMM examples.
 
file  cmm_common.h
 Header for code common to all CMM examples.
 

Functions

void * cmmegMemAlloc (sw_memory_instance *instance, size_t size)
 Allocate CMM memory. More...
 
void cmmegMemFree (sw_memory_instance *instance, void *memory)
 Release CMM memory. More...
 

Detailed Description

The CMM examples share functions to call the sw_memory_api callback API provided by the RIP for allocation and deallocation.

Note
This code should be used for reference purposes only.

Function Documentation

◆ cmmegMemAlloc()

void* cmmegMemAlloc ( sw_memory_instance instance,
size_t  size 
)

Allocate CMM memory.

An trampoline to sw_memory_api::alloc(). This function calls the sw_memory_api passed to the CMM API functions to allocate memory from the RIP.

Parameters
[in]instanceA sw_memory_instance pointer provided to by the RIP.
[in]sizeThe size, in bytes, of the memory allocation request.
Returns
A valid pointer to memory if the allocation succeeded, NULL if the allocation failed.

◆ cmmegMemFree()

void cmmegMemFree ( sw_memory_instance instance,
void *  memory 
)

Release CMM memory.

An trampoline to sw_memory_api::free(). This function calls the sw_memory_api passed to the CMM API functions to free memory to the RIP.

Parameters
[in]instanceA sw_memory_instance pointer provided by the RIP.
[in]memoryA pointer previously allocated by the alloc() method, which has not yet been freed. It is acceptable to pass NULL as the memory parameter, it will be ignored.