mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 08:04:57 +00:00
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:
parent
36af2fdc4f
commit
feb19646df
2 changed files with 2 additions and 2 deletions
|
@ -528,7 +528,7 @@ size_t malloc_size(void const* ptr)
|
||||||
auto* header = (const CommonHeader*)page_base;
|
auto* header = (const CommonHeader*)page_base;
|
||||||
auto size = header->m_size;
|
auto size = header->m_size;
|
||||||
if (header->m_magic == MAGIC_BIGALLOC_HEADER)
|
if (header->m_magic == MAGIC_BIGALLOC_HEADER)
|
||||||
size -= sizeof(CommonHeader);
|
size -= sizeof(BigAllocationBlock);
|
||||||
else
|
else
|
||||||
VERIFY(header->m_magic == MAGIC_PAGE_HEADER);
|
VERIFY(header->m_magic == MAGIC_PAGE_HEADER);
|
||||||
return size;
|
return size;
|
||||||
|
|
|
@ -46,7 +46,7 @@ struct BigAllocationBlock : public CommonHeader {
|
||||||
m_magic = MAGIC_BIGALLOC_HEADER;
|
m_magic = MAGIC_BIGALLOC_HEADER;
|
||||||
m_size = size;
|
m_size = size;
|
||||||
}
|
}
|
||||||
unsigned char* m_slot[0];
|
alignas(16) unsigned char* m_slot[0];
|
||||||
};
|
};
|
||||||
|
|
||||||
struct FreelistEntry {
|
struct FreelistEntry {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue