summaryrefslogtreecommitdiff
path: root/src/kernel/heap.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/kernel/heap.c')
-rw-r--r--src/kernel/heap.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/kernel/heap.c b/src/kernel/heap.c
index db6392f..e2dcbc7 100644
--- a/src/kernel/heap.c
+++ b/src/kernel/heap.c
@@ -26,10 +26,11 @@
typedef struct __attribute__((packed)) heap_chunk {
- unsigned int free:1;
unsigned int size:4; //will use with flags later if needed
unsigned int lsize:4;
- unsigned long reserved:55;
+ unsigned int free:1;
+ unsigned int mutex:1;
+ unsigned long reserved:54;
struct heap_chunk *fd;
struct heap_chunk *bk;
} chunk;
@@ -203,6 +204,7 @@ void *malloc(size_t size) {
return (void *)on_chunk + sizeof(chunk);
}
+
void *realloc(void *old_chunk, size_t size) {
void *new_chunk = malloc(size);
memcpy(new_chunk, old_chunk, CHUNK_SIZE_FROM_INDEX(((chunk *)(old_chunk-24))->size));