Skip to content

Commit f0d893d

Browse files
Just more logs.
1 parent 3fc8df1 commit f0d893d

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

source/kernel/C/heap.c

+8-1
Original file line numberDiff line numberDiff line change
@@ -23,21 +23,28 @@ uint32_t memory_used = 0;
2323

2424
void mm_init(uint32_t kernel_end)
2525
{
26+
info("Initializing heap.", __FILE__);
2627
last_alloc = kernel_end + 0x1000;
2728
heap_begin = last_alloc;
2829
pheap_end = 0x400000;
2930
pheap_begin = pheap_end - (MAX_PAGE_ALIGNED_ALLOCS * 4096);
3031
heap_end = pheap_begin;
3132
heap_begin = heap_end - heap_begin;
3233
pheap_desc = (uint8_t *)malloc(MAX_PAGE_ALIGNED_ALLOCS);
34+
done("Heap initialized.", __FILE__);
3335
}
3436

3537
void mm_extend(uint32_t additional_size)
3638
{
37-
if (additional_size <= 0) return;
39+
if (additional_size <= 0){
40+
warn("mm_extend: Invalid size.", __FILE__);
41+
return;
42+
}
3843

44+
info("Extending heap.", __FILE__);
3945
heap_end += additional_size;
4046
printf("Heap extended by %d bytes. New heap end: 0x%x", additional_size, heap_end);
47+
done("Heap extended.", __FILE__);
4148
}
4249

4350
void mm_print_out()

0 commit comments

Comments
 (0)