Linkerscript now tracks RAM/ROM usage

This commit is contained in:
Icedude907 committed 2023-11-12 15:24:10 +13:00
1 parent 12a64fecb4
commit a0bf504bc1
6 files changed
+64 -63

No files matched your search

+3
View File
@@ -1,8 +1,11 @@
#include "global.h"
#include "malloc.h"
static void *sHeapStart;
static u32 sHeapSize;
__attribute__((section("__EWRAM_HEAP"))) u8 gHeap[HEAP_SIZE] = {0};
#define MALLOC_SYSTEM_ID 0xA3A3
struct MemBlock {
+2 -1
View File
@@ -1,7 +1,6 @@
#ifndef GUARD_ALLOC_H
#define GUARD_ALLOC_H
#define HEAP_SIZE 0x1C000
#define FREE_AND_SET_NULL(ptr) \
{ \
@@ -11,6 +10,8 @@
#define TRY_FREE_AND_SET_NULL(ptr) if (ptr != NULL) FREE_AND_SET_NULL(ptr)
// 122 KB. Max size of the heap without running into other data
#define HEAP_SIZE 0x1C000
extern u8 gHeap[];
void *Alloc(u32 size);