2021-05-27 17:01:26 +00:00
|
|
|
/*
|
2024-10-04 11:19:50 +00:00
|
|
|
* Copyright (c) 2021-2023, Andreas Kling <andreas@ladybird.org>
|
2021-05-27 17:01:26 +00:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <AK/Vector.h>
|
2024-11-14 15:01:23 +00:00
|
|
|
#include <LibGC/Forward.h>
|
2021-05-27 17:01:26 +00:00
|
|
|
|
2024-11-14 15:01:23 +00:00
|
|
|
namespace GC {
|
2021-05-27 17:01:26 +00:00
|
|
|
|
|
|
|
class BlockAllocator {
|
|
|
|
public:
|
2022-03-14 16:25:06 +00:00
|
|
|
BlockAllocator() = default;
|
2021-05-27 17:01:26 +00:00
|
|
|
~BlockAllocator();
|
|
|
|
|
|
|
|
void* allocate_block(char const* name);
|
|
|
|
void deallocate_block(void*);
|
|
|
|
|
|
|
|
private:
|
2023-12-31 10:36:18 +00:00
|
|
|
Vector<void*> m_blocks;
|
2021-05-27 17:01:26 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|