summaryrefslogtreecommitdiff
path: root/stage3/heap.c
diff options
context:
space:
mode:
authorLizzy Fleckenstein <lizzy@vlhl.dev>2023-12-19 01:54:39 +0100
committerLizzy Fleckenstein <lizzy@vlhl.dev>2023-12-19 02:11:32 +0100
commit6d263c7d4e0f4b1d34694b5d3d159ccb20b3db02 (patch)
tree41578268cf68b2d9ea1737687a0f98af979948d8 /stage3/heap.c
parent5881b4d5c1040c762599f90e091e4cc4c3abe6b1 (diff)
downloadcuddles-6d263c7d4e0f4b1d34694b5d3d159ccb20b3db02.tar.xz
keyboard driver and threads
* PS/2 keyboard driver * interactive shell * move away from \0 terminated strings to sized slices * coroutine threads and IRQ queues
Diffstat (limited to 'stage3/heap.c')
-rw-r--r--stage3/heap.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/stage3/heap.c b/stage3/heap.c
index 0a82213..c9e7edb 100644
--- a/stage3/heap.c
+++ b/stage3/heap.c
@@ -18,7 +18,7 @@ void free(void *ptr)
Header *h = ((Header *) ptr) - 1;
if (h->next != MAGIC)
- panic("free: invalid pointer");
+ panic(S("free: invalid pointer"));
Header *next = free_ptr->next;
free_ptr->next = h;
@@ -28,7 +28,7 @@ void free(void *ptr)
static void defragment()
{
//usize num_blocks = 0;
- panic("defragment not implemented");
+ panic(S("defragment not implemented"));
}
void *try_malloc(usize size)
@@ -64,13 +64,13 @@ void *malloc(usize size)
{
void *p;
- p = try_malloc(size);
- if (p) return p;
- defragment();
+ // p = try_malloc(size);
+ // if (p) return p;
+ // defragment();
p = try_malloc(size);
if (p) return p;
- panic("out of memory");
+ panic(S("out of memory"));
return nil;
}
@@ -83,7 +83,7 @@ void *realloc(void *ptr, usize size)
Header *h = ((Header *) ptr) - 1;
if (h->next != MAGIC)
- panic("realloc: invalid pointer");
+ panic(S("realloc: invalid pointer"));
void *new = malloc(size);