mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-10 13:00:29 +03:00
LibJS: Add a 96-byte CellAllocator
Two of our most frequently allocated objects are Shape (88 bytes) and DeclarativeEnvironment (80 bytes). Putting these into 128-byte cells was quite wasteful, so let's add a more suitable allocator for them.
This commit is contained in:
parent
8bdf6441b1
commit
6b5f6d6c0e
Notes:
sideshowbarker
2024-07-17 19:55:44 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/6b5f6d6c0eb
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020, Andreas Kling <kling@serenityos.org>
|
||||
* Copyright (c) 2020-2022, Andreas Kling <kling@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
@ -43,6 +43,7 @@ Heap::Heap(VM& vm)
|
||||
static_assert(HeapBlock::min_possible_cell_size <= 24, "Heap Cell tracking uses too much data!");
|
||||
m_allocators.append(make<CellAllocator>(32));
|
||||
m_allocators.append(make<CellAllocator>(64));
|
||||
m_allocators.append(make<CellAllocator>(96));
|
||||
m_allocators.append(make<CellAllocator>(128));
|
||||
m_allocators.append(make<CellAllocator>(256));
|
||||
m_allocators.append(make<CellAllocator>(512));
|
||||
|
Loading…
Reference in New Issue
Block a user