Add thread-safety options to turtle::system_allocator

This commit is contained in:
kayomn 2023-03-02 23:52:39 +00:00
parent 1b6e80f3f1
commit 7878c52496

View File

@ -34,9 +34,14 @@ export namespace turtle {
};
struct system_allocator : public coral::allocator {
system_allocator() = default;
enum class thread_safety {
none,
mutex,
};
// TODO: implement thread-safety.
system_allocator(thread_safety allocator_thread_safety) {
// TODO: optimize allocator with thread-unsafe variant.
}
coral::u8 * reallocate(coral::u8 * maybe_allocation, coral::usize requested_size) override {
if (maybe_allocation != nullptr) coral::unreachable();