summaryrefslogtreecommitdiff
path: root/src/memory.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/memory.cc')
-rw-r--r--src/memory.cc5
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);
}