aboutsummaryrefslogtreecommitdiff
path: root/arch/x86_64/src/kernel/main.cpp
diff options
context:
space:
mode:
authorMatteo Gmür <matteo.gmuer1@ost.ch>2024-12-02 11:14:43 +0000
committerMatteo Gmür <matteo.gmuer1@ost.ch>2024-12-02 11:14:43 +0000
commitaa4de534ec7bf0b609aff032c4649484aa49823c (patch)
tree45a53137b0f7f67fe4db05091b9d2a54f1728bb7 /arch/x86_64/src/kernel/main.cpp
parenta5e5eabd32872f81a7190589aa648dc0e1963888 (diff)
downloadteachos-aa4de534ec7bf0b609aff032c4649484aa49823c.tar.xz
teachos-aa4de534ec7bf0b609aff032c4649484aa49823c.zip
Add check to detect double free in linked list allocator
Diffstat (limited to 'arch/x86_64/src/kernel/main.cpp')
-rw-r--r--arch/x86_64/src/kernel/main.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/x86_64/src/kernel/main.cpp b/arch/x86_64/src/kernel/main.cpp
index 7992b34..e68f0fe 100644
--- a/arch/x86_64/src/kernel/main.cpp
+++ b/arch/x86_64/src/kernel/main.cpp
@@ -42,9 +42,10 @@ namespace teachos::arch::kernel
heap_allocator.deallocate(test, 1024);
- heap_allocator.allocate(1024); // test 9
+ auto test9 = heap_allocator.allocate(1024);
auto test10 = heap_allocator.allocate(1024);
auto test11 = heap_allocator.allocate(1024);
+ heap_allocator.deallocate(test9, 1024);
auto test12 = heap_allocator.allocate(1024);
heap_allocator.allocate(1024); // test 13
heap_allocator.deallocate(test11, 1024);