1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-07 23:47:34 +00:00

LibJS: Always inline HeapBlock::allocate()

This thing is so simple and sits on the hot path so just inline it.
This commit is contained in:
Andreas Kling 2020-10-04 18:11:54 +02:00
parent ad0d377e4c
commit 2852ce4954
2 changed files with 7 additions and 8 deletions

View file

@ -73,13 +73,6 @@ HeapBlock::HeapBlock(Heap& heap, size_t cell_size)
m_freelist = next;
}
Cell* HeapBlock::allocate()
{
if (!m_freelist)
return nullptr;
return exchange(m_freelist, m_freelist->next);
}
void HeapBlock::deallocate(Cell* cell)
{
ASSERT(cell->is_live());