summaryrefslogtreecommitdiff
path: root/Kernel
diff options
context:
space:
mode:
authorTom <tomut@yahoo.com>2020-11-01 08:50:03 -0700
committerAndreas Kling <kling@serenityos.org>2020-11-01 18:47:01 +0100
commit656ffe36f20d33286c9f640259be234a78667015 (patch)
tree7bd2ef6c899c3b6f8d5579b7736ea66e4832149e /Kernel
parent1aed61964a2b0f7447b1370c97be27774ebcddea (diff)
downloadserenity-656ffe36f20d33286c9f640259be234a78667015.zip
Kernel: kmalloc_eternal should align pointers
Diffstat (limited to 'Kernel')
-rw-r--r--Kernel/Heap/kmalloc.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/Kernel/Heap/kmalloc.cpp b/Kernel/Heap/kmalloc.cpp
index 19113958b0..ecbbda1114 100644
--- a/Kernel/Heap/kmalloc.cpp
+++ b/Kernel/Heap/kmalloc.cpp
@@ -199,6 +199,8 @@ void kmalloc_init()
void* kmalloc_eternal(size_t size)
{
+ size = round_up_to_power_of_two(size, sizeof(void*));
+
ScopedSpinLock lock(s_lock);
void* ptr = s_next_eternal_ptr;
s_next_eternal_ptr += size;