Harlequin RIP SDK

A structure containing callback functions for memory allocation. More...

#include "swmemapi.h"

Data Fields

sw_api_info info
 Version number, name, display name, and instance size. More...
 
void *(* alloc )(sw_memory_instance *instance, size_t size)
 Allocate a block of memory size bytes long. More...
 
void(* free )(sw_memory_instance *instance, void *memory)
 Free a previously allocated block. More...
 

Detailed Description

A structure containing callback functions for memory allocation.

The RIP will provide the module with these callbacks (in the form of memory API instances), which should be used in preference to those provided by the platform. Failure to do this may result in difficulties in configuring the rip for optimal performance. Memory API instances are subclassed by the RIP to encapsulate parameters for particular memory allocators.

Field Documentation

◆ alloc

void*( * sw_memory_api::alloc) (sw_memory_instance *instance, size_t size)

Allocate a block of memory size bytes long.

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.

◆ free

void( * sw_memory_api::free) (sw_memory_instance *instance, void *memory)

Free a previously allocated block.

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.

◆ info

sw_api_info sw_memory_api::info

Version number, name, display name, and instance size.

This is REQUIRED to be the first field.


The documentation for this struct was generated from the following file: