![]() |
RTOS_MSPM0
1.1
ECE445M starter code
|
heap memory manager More...
#include <stdint.h>Go to the source code of this file.
Data Structures | |
| struct | heap_stats |
Typedefs | |
| typedef struct heap_stats | heap_stats_t |
Functions | |
| int32_t | Heap_Init (void) |
| Initializes/resets the heap to a clean state where no memory is allocated. More... | |
| void * | Heap_Malloc (int32_t desiredBytes) |
| Allocate memory. More... | |
| void * | Heap_Calloc (int32_t desiredBytes) |
| Zero-allocate memory. More... | |
| void * | Heap_Realloc (void *oldBlock, int32_t desiredBytes) |
| Grow/shrink memory. More... | |
| int32_t | Heap_Free (void *pointer) |
| Free memory. More... | |
| int32_t | Heap_Stats (heap_stats_t *stats) |
| Get heap usage. More... | |
heap memory manager
Dynamic memory management on a heap
| void* Heap_Calloc | ( | int32_t | desiredBytes | ) |
Zero-allocate memory.
Allocate memory, allocated memory is initialized to 0 (zeroed out)
| desiredBytes | desired number of bytes to allocate |
| int32_t Heap_Free | ( | void * | pointer | ) |
Free memory.
Return a block to the heap
| pointer | to memory to unallocate |
| int32_t Heap_Init | ( | void | ) |
Initializes/resets the heap to a clean state where no memory is allocated.
Initialize the Heap
| none |
| void* Heap_Malloc | ( | int32_t | desiredBytes | ) |
Allocate memory.
Allocate memory, data not initialized
| desiredBytes | desired number of bytes to allocate |
| void* Heap_Realloc | ( | void * | oldBlock, |
| int32_t | desiredBytes | ||
| ) |
Grow/shrink memory.
Reallocate buffer to a new size. The given block may be unallocated and its contents copied to a new block
| oldBlock | pointer to a block |
| desiredBytes | a desired number of bytes for a new block |
| int32_t Heap_Stats | ( | heap_stats_t * | stats | ) |
Get heap usage.
Return the current usage status of the heap
| reference | to a heap_stats_t that returns the current usage of the heap |