diff options
Diffstat (limited to 'stage3/heap.c')
-rw-r--r-- | stage3/heap.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/stage3/heap.c b/stage3/heap.c index 2c54d8c..0e9a8d6 100644 --- a/stage3/heap.c +++ b/stage3/heap.c @@ -9,6 +9,7 @@ static heap_header init_free_ptr; static heap_header *free_ptr = nil; +static usize total_size = 0; #ifdef DEBUG void heap_check() @@ -127,9 +128,16 @@ void heap_add(void *ptr, usize size) h->size = size - sizeof(heap_header); kfree(h + 1); + + total_size += size; } heap_header *heap_get_free_ptr() { return free_ptr; } + +usize heap_total_size() +{ + return total_size; +} |