Add thread-safety options to turtle::system_allocator
This commit is contained in:
parent
1b6e80f3f1
commit
7878c52496
@ -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();
|
||||
|
Loading…
x
Reference in New Issue
Block a user