From 3a9f7e6c9e1f44385c1950edc6267af8eea56a7e Mon Sep 17 00:00:00 2001 From: Fabrice Date: Tue, 3 Mar 2026 09:42:37 +0100 Subject: formatting of tokens --- src/memory.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/memory.cc') diff --git a/src/memory.cc b/src/memory.cc index 22977d1..720c100 100644 --- a/src/memory.cc +++ b/src/memory.cc @@ -16,7 +16,7 @@ struct Allocator { Allocator_Deallocate deallocate; }; -template +template T* allocate(const Allocator* allocator, usize n) { return (T*)allocator->allocate(allocator->self, sizeof(T) * n, alignof(T)); } @@ -48,7 +48,7 @@ const Allocator* heap_allocator() { template bool slice_copy(const Allocator* allocator, const Slice* source, Slice* out) { - T* new_ptr = allocate(allocator, source->size(), alignof(T)); + T* new_ptr = allocate(allocator, source->total_length(), alignof(T)); if (new_ptr == nullptr) return false; memcpy((u8*)new_ptr, (u8*)source->ptr, source->length); -- cgit v1.2.3