From a1db1cd9e22e77041d5f1360f1d1ccdc52b86306 Mon Sep 17 00:00:00 2001 From: Steven Le Rouzic Date: Mon, 26 May 2025 00:47:54 +0200 Subject: Implement chunked_buffer --- asl/memory/allocator.hpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'asl/memory/allocator.hpp') diff --git a/asl/memory/allocator.hpp b/asl/memory/allocator.hpp index a231558..f2e2dce 100644 --- a/asl/memory/allocator.hpp +++ b/asl/memory/allocator.hpp @@ -40,6 +40,21 @@ T* alloc_new(allocator auto& a, auto&&... args) return construct_at(ptr, std::forward(args)...); } +template +T* alloc_uninit(allocator auto& a) + requires trivially_default_constructible +{ + void* ptr = a.alloc(layout::of()); + return reinterpret_cast(ptr); // NOLINT(*-reinterpret-cast) +} + +template +T* alloc_uninit_unsafe(allocator auto& a) +{ + void* ptr = a.alloc(layout::of()); + return reinterpret_cast(ptr); // NOLINT(*-reinterpret-cast) +} + template void alloc_delete(allocator auto& a, T* ptr) { -- cgit