For more details and example usage, see Heap
◆ HeapP_BYTE_ALIGNMENT
#define HeapP_BYTE_ALIGNMENT (64u) |
Minimum alignment for heap allocations, in units of bytes.
◆ HeapP_OBJECT_SIZE_MAX
#define HeapP_OBJECT_SIZE_MAX (128U) |
Max size of heap object across no-RTOS and all OS's.
◆ HeapP_construct()
void HeapP_construct |
( |
HeapP_Object * |
heap, |
|
|
void * |
heapAddr, |
|
|
size_t |
heapSize |
|
) |
| |
Create a user defined heap.
The actual heap start address and size will be adjusted to satisfy HeapP_BYTE_ALIGNMENT.
- Parameters
-
heap | [out] Intialized heap handle to be used for subsequent API calls |
heapAddr | [in] Base address of memory to be used as heap |
heapSize | [in] Size of memory block that is to be used as heap |
◆ HeapP_destruct()
Delete the user defined heap.
- Parameters
-
◆ HeapP_alloc()
Alloc memory from user defined heap.
- Parameters
-
heap | [in] Heap handle |
allocSize | [in] Size of memory to allocate |
- Returns
- pointer to allcoated memory
-
NULL memory could not be allocated since a free block of required size could not be found
◆ HeapP_free()
Free memory from user defined heap.
- Parameters
-
heap | [in] Heap handle |
ptr | [in] Pointer to memory allocated using HeapP_alloc |
◆ HeapP_getFreeHeapSize()
Get free heap size, in bytes.
- Parameters
-
- Returns
- Free memory size in this heap, in bytes
◆ HeapP_getMinimumEverFreeHeapSize()
size_t HeapP_getMinimumEverFreeHeapSize |
( |
HeapP_Object * |
heap | ) |
|
Get lowest ever free heap size, in bytes.
- Parameters
-
- Returns
- Lowest ever free heap size, in bytes
◆ HeapP_getHeapStats()
Get detailed heap statistics.
- Parameters
-
heap | [in] Heap handle |
pHeapStats | [out] Returned heap statistics |