Heap

This module includes functions that set the external OpenThread heap.

Typedefs

typedef void *(* otHeapCAllocFn) (size_t aCount, size_t aSize)
 Function pointer used to set external CAlloc function for OpenThread.
 
typedef void(* otHeapFreeFn) (void *aPointer)
 Function pointer used to set external Free function for OpenThread.

Functions

void * otHeapCAlloc (size_t aCount, size_t aSize)
 
void otHeapFree (void *aPointer)
 
void otHeapSetCAllocFree (otHeapCAllocFn aCAlloc, otHeapFreeFn aFree)
 This function sets the external heap CAlloc and Free functions to be used by the OpenThread stack.

Detailed Description

This module includes functions that set the external OpenThread heap.

Typedef Documentation

◆ otHeapCAllocFn

typedef void*(* otHeapCAllocFn) (size_t aCount, size_t aSize)

Function pointer used to set external CAlloc function for OpenThread.

Parameters
[in]aCountNumber of allocate units.
[in]aSizeUnit size in bytes.
Returns
A pointer to the allocated memory.
Return values
NULLIndicates not enough memory.

◆ otHeapFreeFn

typedef void(* otHeapFreeFn) (void *aPointer)

Function pointer used to set external Free function for OpenThread.

Parameters
[in]aPointerA pointer to the memory to free.

Function Documentation

◆ otHeapCAlloc()

void* otHeapCAlloc ( size_t  aCount,
size_t  aSize 
)
Note
This API is deprecated and use of it is discouraged.

◆ otHeapFree()

void otHeapFree ( void *  aPointer)
Note
This API is deprecated and use of it is discouraged.

◆ otHeapSetCAllocFree()

void otHeapSetCAllocFree ( otHeapCAllocFn  aCAlloc,
otHeapFreeFn  aFree 
)

This function sets the external heap CAlloc and Free functions to be used by the OpenThread stack.

This function must be used before invoking instance initialization.

Parameters
[in]aCAllocA pointer to external CAlloc function.
[in]aFreeA pointer to external Free function.