Picasso API  2.9
Data Structures | Typedefs | Functions
Memory Management

Data Structures

struct  _ps_memory_funcs
 Memory allocator functions structure. More...
 

Typedefs

typedef void *(* ps_malloc_func) (size_t size)
 Memory allocation function pointer type. More...
 
typedef void(* ps_free_func) (void *ptr)
 Memory free function pointer type. More...
 
typedef void *(* ps_calloc_func) (size_t num, size_t size)
 Memory calloc function pointer type. More...
 
typedef struct _ps_memory_funcs ps_memory_funcs
 Memory allocator functions structure.
 

Functions

PEXPORT ps_bool PICAPI ps_set_memory_functions (const ps_memory_funcs *funcs)
 Set global memory allocation functions. More...
 

Detailed Description

Typedef Documentation

◆ ps_calloc_func

typedef void*(* ps_calloc_func) (size_t num, size_t size)

Memory calloc function pointer type.

Parameters
numNumber of elements
sizeSize of each element in bytes
Returns
Pointer to allocated memory or NULL on failure

Definition at line 58 of file picasso_backport.h.

◆ ps_free_func

typedef void(* ps_free_func) (void *ptr)

Memory free function pointer type.

Parameters
ptrPointer to memory to free

Definition at line 50 of file picasso_backport.h.

◆ ps_malloc_func

typedef void*(* ps_malloc_func) (size_t size)

Memory allocation function pointer type.

Parameters
sizeSize in bytes to allocate
Returns
Pointer to allocated memory or NULL on failure

Definition at line 44 of file picasso_backport.h.

Function Documentation

◆ ps_set_memory_functions()

ps_bool ps_set_memory_functions ( const ps_memory_funcs funcs)

Set global memory allocation functions.

This function allows you to override the default memory allocation functions used throughout the Picasso library. All memory allocations will be redirected to the provided functions.

Parameters
funcsPointer to structure containing memory function pointers.
Returns
True on success, False on failure
Note
This function must be called before ps_initialize() and cannot be called after the library has been initialized.
All function pointers must be valid; NULL pointers are not allowed.