mirror of
https://github.com/ringtailsoftware/uvm32.git
synced 2026-06-05 22:43:39 +00:00
Example of setting up malloc heap on extram
This commit is contained in:
parent
7fae8c129f
commit
f27ed6213c
5 changed files with 369 additions and 0 deletions
30
apps/heap/malloc_freelist.h
Normal file
30
apps/heap/malloc_freelist.h
Normal 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_
|
||||
Loading…
Add table
Add a link
Reference in a new issue