Newer
Older
minerva / Userland / Libraries / LibJS / Heap / BlockAllocator.h
@minerva minerva on 13 Jul 407 bytes Initial commit
/*
 * Copyright (c) 2021-2023, Andreas Kling <kling@serenityos.org>
 *
 * SPDX-License-Identifier: BSD-2-Clause
 */

#pragma once

#include <AK/Vector.h>
#include <LibJS/Forward.h>

namespace JS {

class BlockAllocator {
public:
    BlockAllocator() = default;
    ~BlockAllocator();

    void* allocate_block(char const* name);
    void deallocate_block(void*);

private:
    Vector<void*> m_blocks;
};

}