mirror of
https://github.com/SerenityOS/serenity.git
synced 2026-11-07 04:29:30 -10:00
Kernel: Use alignas in Heap::AllocationHeader
Instead of adding manual padding and only on x86-64 and AArch64, use `alignas(16)` for all architectures to ensure that allocations are aligned on a 16 byte boundary. This was originally guarded behind a `ARCH(X86_64)` when x86-64 support was originally added.
This commit is contained in:
1 parent
6dbd60df59
commit
e26ee9b74d
1 file changed
+1
-5
+1
-5
@@ -26,11 +26,7 @@ class Heap {
|
||||
|
||||
struct AllocationHeader {
|
||||
size_t allocation_size_in_chunks;
|
||||
#if ARCH(X86_64) || ARCH(AARCH64)
|
||||
// FIXME: Get rid of this somehow
|
||||
size_t alignment_dummy;
|
||||
#endif
|
||||
u8 data[0];
|
||||
alignas(16) u8 data[0];
|
||||
};
|
||||
|
||||
static_assert(CHUNK_SIZE >= sizeof(AllocationHeader));
|
||||
|
||||
Reference in new issue
Block a user