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:
Sönke Holz authored and Nico Weber committed 2026-01-07 14:03:14 -05:00
1 parent 6dbd60df59
commit e26ee9b74d
1 file changed
+1 -5
+1 -5
View File
@@ -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));