Helium
Functions
memory.h File Reference

Customisation of allocators if desired. More...

#include "he.h"
Include dependency graph for memory.h:

Go to the source code of this file.

Functions

he_return_code_t he_set_allocators (he_malloc_t malloc, he_calloc_t calloc, he_realloc_t realloc, he_free_t free)
 Set allocators for use by libhelium. More...
 
void * he_internal_malloc (size_t size)
 
void * he_internal_calloc (size_t nmemb, size_t size)
 
void * he_internal_realloc (void *ptr, size_t size)
 
void he_internal_free (void *ptr)
 

Detailed Description

Customisation of allocators if desired.

Function Documentation

he_return_code_t he_set_allocators ( he_malloc_t  malloc,
he_calloc_t  calloc,
he_realloc_t  realloc,
he_free_t  free 
)

Set allocators for use by libhelium.

Parameters
mallocA function that conforms to the signature of malloc(3)
callocA function that conforms to the signature of calloc(3)
reallocA function that conforms to the signature of realloc(3)
freeA function that conforms to the signature of free(3)
Returns
HE_SUCCESS Currently this function cannot fail
Note
If this function is not called, Helium will use system allocators by default