#pragma once #include #include #include #include constexpr void* operator new(size_t, void* ptr) { return ptr; } namespace types { template concept Allocator = requires(size_t size, typename T::value_type* ptr) { typename T::value_type; { T::allocate_memory(size) } -> same_as; { T::deallocate_memory(ptr) } -> same_as; }; template class allocator_traits; template class kernel_allocator { public: using value_type = T; static constexpr value_type* allocate_memory(size_t count) { return static_cast(::k_malloc(count)); } static constexpr void deallocate_memory(value_type* ptr) { ::k_free(ptr); } }; template class kernel_ident_allocator { public: using value_type = T; static constexpr value_type* allocate_memory(size_t count) { return static_cast(::ki_malloc(count)); } static constexpr void deallocate_memory(value_type* ptr) { ::ki_free(ptr); } }; template