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_construct()
int32_t HeapP_construct |
( |
HeapP_Object * |
heapObj, |
|
|
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
-
heapObj | [out] Initalized heap object 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 |
- Returns
- SystemP_SUCCESS on success, SystemP_FAILURE on error
◆ HeapP_destruct()
Delete the user defined heap.
- Parameters
-
◆ HeapP_alloc()
void* HeapP_alloc |
( |
HeapP_Object * |
heapObj, |
|
|
size_t |
allocSize |
|
) |
| |
Alloc memory from user defined heap.
- Parameters
-
heapObj | [in] Heap object |
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()
◆ 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 * |
heapObj | ) |
|
Get lowest ever free heap size, in bytes.
- Parameters
-
- Returns
- Lowest ever free heap size, in bytes
◆ HeapP_getHeapStats()
Get detailed heap statistics.
- Parameters
-
heapObj | [in] Heap object |
pHeapStats | [out] Returned heap statistics |
- Returns
- SystemP_SUCCESS on success, SystemP_FAILURE on error