TCPIP_STACK_HEAP_EXTERNAL_CONFIG Structure
C
typedef struct {
TCPIP_STACK_HEAP_TYPE heapType;
TCPIP_STACK_HEAP_FLAGS heapFlags;
TCPIP_STACK_HEAP_USAGE heapUsage;
void* (* malloc_fnc)(size_t bytes);
void* (* calloc_fnc)(size_t nElems, size_t elemSize);
void (* free_fnc)(void* ptr);
} TCPIP_STACK_HEAP_EXTERNAL_CONFIG;
Description
External heap configuration data.
This data type defines the data required to intialize the TCP/IP stack external heap.
Members
Members | Description |
---|---|
heapType | Type of this heap: TCPIP_STACK_HEAP_TYPE_EXTERNAL_HEAP. |
heapFlags | Heap creation flags. TCPIP_STACK_HEAP_FLAG_ALLOC_UNCACHED will be always internally set. TCPIP_STACK_HEAP_FLAG_NO_MTHREAD_SYNC should be cleared if the external heap functions provide multi-threaded synchronization. Should be set if the synchronization needs to be provided by the TCP/IP heap implementation. TCPIP_STACK_HEAP_FLAG_ALLOC_UNALIGN should be set if the external heap functions provide cache line aligned buffers. |
heapUsage | Currently not used. |
(* malloc_fnc)(size_t bytes) | Malloc style function to be called when allocation is needed. |
(* calloc_fnc)(size_t nElems, size_t elemSize) | Calloc style function to be called when allocation is needed. |
(* free_fnc)(void* ptr) | Free style function for releasing the allocated memory. |
Remarks
Due to the internal alignment restrictions the externally supplied calloc function is not currently used. Instead, a less efficient approach is taken: the malloc function is used and the resulted buffer is zeroed out.