aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Cunningham <cc@localhost>2022-01-11 18:28:15 -0700
committerChristian Cunningham <cc@localhost>2022-01-11 18:28:15 -0700
commit8520d34e890885c19966346155675a2532b6feda (patch)
tree0be88ac50a303ff00542f43e7aa433fcc03ed10e
parent5b3ceca69d5432f976ac487c63a75f8c6275028b (diff)
Fixed heap free information bug
-rw-r--r--src/lib/mem.c2
-rw-r--r--src/sys/core.c1
2 files changed, 2 insertions, 1 deletions
diff --git a/src/lib/mem.c b/src/lib/mem.c
index fcaea4b..ac5db4d 100644
--- a/src/lib/mem.c
+++ b/src/lib/mem.c
@@ -188,7 +188,7 @@ void heap_info_u(void)
while ((void*)base < rpi_heap_top) {
unsigned char size = base[MEM_SIZE_OFFSET];
if(base[MEM_USE_OFFSET] == 0) {
- base += MEM_META_SIZE;
+ base += size + MEM_META_SIZE;
continue;
}
uart_hex((unsigned long)(base + MEM_BASE_SIZE));
diff --git a/src/sys/core.c b/src/sys/core.c
index b492548..13fdbfe 100644
--- a/src/sys/core.c
+++ b/src/sys/core.c
@@ -60,6 +60,7 @@ void sysinit(void)
add_thread(testlocal, 0);
add_thread(testlocal, 1);
add_thread(testlocal, 3);
+ void* a = malloca(7, 9);
}
struct Mutex testm = {.addr = (void*)0xDEADBEEF, .pid = NULL_PID};