1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 15:38:10 +00:00

LibJS: Rename Allocator => CellAllocator

Now that we have a BlockAllocator as well, it seems appropriate to name
the allocator-that-allocates-cells something more specific to match.
This commit is contained in:
Andreas Kling 2021-05-27 19:03:41 +02:00
parent e9081a2644
commit 9b699bad94
6 changed files with 24 additions and 24 deletions

View file

@ -10,7 +10,7 @@
#include <AK/StackInfo.h>
#include <AK/TemporaryChange.h>
#include <LibCore/ElapsedTimer.h>
#include <LibJS/Heap/Allocator.h>
#include <LibJS/Heap/CellAllocator.h>
#include <LibJS/Heap/Handle.h>
#include <LibJS/Heap/Heap.h>
#include <LibJS/Heap/HeapBlock.h>
@ -23,14 +23,14 @@ namespace JS {
Heap::Heap(VM& vm)
: m_vm(vm)
{
m_allocators.append(make<Allocator>(16));
m_allocators.append(make<Allocator>(32));
m_allocators.append(make<Allocator>(64));
m_allocators.append(make<Allocator>(128));
m_allocators.append(make<Allocator>(256));
m_allocators.append(make<Allocator>(512));
m_allocators.append(make<Allocator>(1024));
m_allocators.append(make<Allocator>(3072));
m_allocators.append(make<CellAllocator>(16));
m_allocators.append(make<CellAllocator>(32));
m_allocators.append(make<CellAllocator>(64));
m_allocators.append(make<CellAllocator>(128));
m_allocators.append(make<CellAllocator>(256));
m_allocators.append(make<CellAllocator>(512));
m_allocators.append(make<CellAllocator>(1024));
m_allocators.append(make<CellAllocator>(3072));
}
Heap::~Heap()
@ -38,7 +38,7 @@ Heap::~Heap()
collect_garbage(CollectionType::CollectEverything);
}
ALWAYS_INLINE Allocator& Heap::allocator_for_size(size_t cell_size)
ALWAYS_INLINE CellAllocator& Heap::allocator_for_size(size_t cell_size)
{
for (auto& allocator : m_allocators) {
if (allocator->cell_size() >= cell_size)