Heap

This module includes functions that set the external OpenThread heap.

Summary

Typedefs

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

Functions

otHeapSetCAllocFree(otHeapCAllocFn aCAlloc, otHeapFreeFn aFree)
void
This function sets the external heap CAlloc and Free functions to be used by the OpenThread stack.

Typedefs

otHeapCAllocFn

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

Function pointer used to set external CAlloc function for OpenThread.

Details
Parameters
[in] aCount
Number of allocate units.
[in] aSize
Unit size in bytes.
Return Values
NULL
Indicates not enough memory.
Returns
A pointer to the allocated memory.

otHeapFreeFn

void(* otHeapFreeFn)(void *aPointer)

Function pointer used to set external Free function for OpenThread.

Details
Parameters
[in] aPointer
A pointer to the memory to free.

Functions

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.

Details
Parameters
[in] aCAlloc
A pointer to external CAlloc function.
[in] aFree
A pointer to external Free function.