From 223b96c820c516c96c0d7dc9b860369b13633643 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Tue, 21 Jul 2020 22:47:51 +0200 Subject: [PATCH] LibC: Make sure malloc chunks are 8-byte aligned I noticed this while doing some instruction-level debugging. :^) --- Libraries/LibC/malloc.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Libraries/LibC/malloc.cpp b/Libraries/LibC/malloc.cpp index 552d4d2ed6..2ddcd7a9ab 100644 --- a/Libraries/LibC/malloc.cpp +++ b/Libraries/LibC/malloc.cpp @@ -116,7 +116,7 @@ struct ChunkedBlock ChunkedBlock* m_next { nullptr }; FreelistEntry* m_freelist { nullptr }; unsigned short m_free_chunks { 0 }; - unsigned char m_slot[0]; + [[gnu::aligned(8)]] unsigned char m_slot[0]; void* chunk(size_t index) {