heap: Quality updates to heap management

- Allow reuse of unused sections that fit exactly to selected allocation size. Decreases fragmentation dramatically.
- Always allocate and align mapped memory to selected alignment. Avoids having fragmented unused maps that are not aligned.
- Use a static alignment based on BPMP and generally average cache line size. Boosts performance when MMU is used.
This commit is contained in:
CTCaer
2019-12-04 19:02:28 +02:00
parent d1e50c558e
commit ec10b572d1
5 changed files with 114 additions and 29 deletions

View File

@@ -18,10 +18,12 @@
#define _HEAP_H_
#include "../utils/types.h"
#include "../../../common/common_heap.h"
void heap_init(u32 base);
void *malloc(u32 size);
void *calloc(u32 num, u32 size);
void free(void *buf);
void heap_monitor(heap_monitor_t *mon, bool print_node_stats);
#endif