Memory Management
Dynamic memory allocation from FreeRTOS heap
void* os_malloc(size_t size)
Allocate memory from FreeRTOS heap
| size_t | size | Number of bytes to allocate |
Returns — Pointer to allocated memory, or NULL if out of memory
void* buffer = os_malloc(1024);
if (buffer) {
// Use buffer
os_free(buffer);
}Note — Memory is limited - always check return values
void os_free(void* ptr)
Free memory allocated with os_malloc
| void* | ptr | Pointer returned by os_malloc (NULL is safely ignored) |