LibC: Increase alignment for malloc() BigAllocationBlocks to 16 bytes

commit 5f3773b715 increased alignment
for ChunckedBlocks, but not for BigAllocationBlocks.

This is required to make SSE instructions work.
This commit is contained in:
Peter Ross 2022-03-01 19:50:19 +11:00 committed by Andreas Kling
parent 36af2fdc4f
commit feb19646df
Notes: sideshowbarker 2024-07-17 18:04:09 +09:00
2 changed files with 2 additions and 2 deletions

View file

@ -528,7 +528,7 @@ size_t malloc_size(void const* ptr)
auto* header = (const CommonHeader*)page_base;
auto size = header->m_size;
if (header->m_magic == MAGIC_BIGALLOC_HEADER)
size -= sizeof(CommonHeader);
size -= sizeof(BigAllocationBlock);
else
VERIFY(header->m_magic == MAGIC_PAGE_HEADER);
return size;

View file

@ -46,7 +46,7 @@ struct BigAllocationBlock : public CommonHeader {
m_magic = MAGIC_BIGALLOC_HEADER;
m_size = size;
}
unsigned char* m_slot[0];
alignas(16) unsigned char* m_slot[0];
};
struct FreelistEntry {