#pragma once #include "asl/layout.hpp" #include "asl/meta.hpp" namespace asl { template concept allocator = moveable && requires(T& alloc, layout layout, void* ptr) { { alloc.alloc(layout) } -> same_as; { alloc.realloc(ptr, layout, layout) } -> same_as; alloc.dealloc(ptr, layout); }; class GlobalHeap { public: static void* alloc(const layout&); static void* realloc(void* ptr, const layout& old, const layout& new_layout); static void dealloc(void* ptr, const layout&); }; static_assert(allocator); using DefaultAllocator = GlobalHeap; } // namespace asl