diff options
| author | Fabrice <fabrice@schaub-dev.xyz> | 2026-03-02 21:56:42 +0100 |
|---|---|---|
| committer | Fabrice <fabrice@schaub-dev.xyz> | 2026-03-02 21:56:42 +0100 |
| commit | 176b2b462371cd860ac9c6b5d2c1db92ae707e88 (patch) | |
| tree | 983d1ddbae380eca94dfebfaf15fdf3245ba284c /src/memory.cc | |
| parent | cb95ef0b3690e7817db34e3a7c0d7c021a7a8ccf (diff) | |
dont need array
Diffstat (limited to 'src/memory.cc')
| -rw-r--r-- | src/memory.cc | 5 |
1 files changed, 5 insertions, 0 deletions
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<typename T> +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); } |
