From 176b2b462371cd860ac9c6b5d2c1db92ae707e88 Mon Sep 17 00:00:00 2001 From: Fabrice Date: Mon, 2 Mar 2026 21:56:42 +0100 Subject: dont need array --- src/memory.cc | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/memory.cc') diff --git a/src/memory.cc b/src/memory.cc index cf8f88c..bb0ecb1 100644 --- a/src/memory.cc +++ b/src/memory.cc @@ -16,6 +16,11 @@ struct Allocator { Allocator_Deallocate deallocate; }; +template +T* allocate(const Allocator* allocator, usize n) { + return allocator->allocate(allocator->self, sizeof(T) * n, alignof(T)); +} + u8* allocate(const Allocator* allocator, usize size, usize align) { return allocator->allocate(allocator->self, size, align); } -- cgit v1.2.3