diff options
| author | Fabrice <fabrice@schaub-dev.xyz> | 2026-03-03 09:42:37 +0100 |
|---|---|---|
| committer | Fabrice <fabrice@schaub-dev.xyz> | 2026-03-03 09:42:37 +0100 |
| commit | 3a9f7e6c9e1f44385c1950edc6267af8eea56a7e (patch) | |
| tree | fbf7175fbaec5d9776d105a6488680c87a694a61 /src/memory.cc | |
| parent | 7ff9d2586a666bd420b98eb9f8de130cf57cd59d (diff) | |
formatting of tokens
Diffstat (limited to 'src/memory.cc')
| -rw-r--r-- | src/memory.cc | 4 |
1 files changed, 2 insertions, 2 deletions
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<typename T> +template <typename T> 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 <typename T> bool slice_copy(const Allocator* allocator, const Slice<T>* source, Slice<T>* 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); |
