Example of setting up malloc heap on extram

This commit is contained in:
Toby Jaffey 2025-12-11 20:35:11 +00:00
parent 7fae8c129f
commit f27ed6213c
5 changed files with 369 additions and 0 deletions

View file

@ -0,0 +1,30 @@
#ifndef __MALLOC_FREELIST_H_
#define __MALLOC_FREELIST_H_
#include "uvm32_target.h"
#ifdef __cplusplus
extern "C"
{
#endif //__cplusplus
/**
* Initialize malloc with a memory address and pool size
*/
void malloc_addblock(void* addr, size_t size);
/**
* Free-list malloc implementation
*/
void* fl_malloc(size_t size);
/**
* Corresponding free-list free implementation
*/
void fl_free(void* ptr);
#ifdef __cplusplus
}
#endif //__cplusplus
#endif //__MALLOC_FREELIST_H_