summaryrefslogtreecommitdiff
path: root/deimos/core/allocator.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'deimos/core/allocator.cpp')
-rw-r--r--deimos/core/allocator.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/deimos/core/allocator.cpp b/deimos/core/allocator.cpp
index a525bfd..f7217c8 100644
--- a/deimos/core/allocator.cpp
+++ b/deimos/core/allocator.cpp
@@ -8,11 +8,9 @@ namespace deimos
class SystemAllocatorImpl : public IAllocator
{
public:
- SystemAllocatorImpl() : IAllocator(MemoryScope{0}) {}
-
void* Reallocate(
void* old_ptr, int64 /* old_size */, int64 new_size,
- const char* /* file */, int32 /* line */) override
+ MemoryScope /* scope */, const SourceLocation& /* source_location */) override
{
if (old_ptr == nullptr)
{
@@ -37,17 +35,19 @@ public:
class AllocatorApiImpl : public AllocatorApi
{
SystemAllocatorImpl m_system_impl;
+ Allocator m_system;
public:
- AllocatorApiImpl()
+ constexpr AllocatorApiImpl() :
+ m_system{ &m_system_impl, {0} }
{
- system = &m_system_impl;
+ system = &m_system;
}
};
AllocatorApi* BootstrapAllocatorApi()
{
- static AllocatorApiImpl g_instance{};
+ static constinit AllocatorApiImpl g_instance{};
return &g_instance;
}