/* * Copyright (c) 2021, Andreas Kling * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include #include namespace JS { class BlockAllocator { public: BlockAllocator() = default; ~BlockAllocator(); void* allocate_block(char const* name); void deallocate_block(void*); private: static constexpr size_t max_cached_blocks = 512; Vector m_blocks; }; }