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