summaryrefslogtreecommitdiffstats
path: root/compiler/utils/arena_allocator.h
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/utils/arena_allocator.h')
-rw-r--r--compiler/utils/arena_allocator.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/compiler/utils/arena_allocator.h b/compiler/utils/arena_allocator.h
index 032eabc..dbe482d 100644
--- a/compiler/utils/arena_allocator.h
+++ b/compiler/utils/arena_allocator.h
@@ -170,6 +170,10 @@ class ArenaAllocator : private ArenaAllocatorStats {
return ret;
}
+ template <typename T> T* AllocArray(size_t length) {
+ return static_cast<T*>(Alloc(length * sizeof(T), kArenaAllocMisc));
+ }
+
void* AllocValgrind(size_t bytes, ArenaAllocKind kind);
void ObtainNewArenaForAllocation(size_t allocation_size);
size_t BytesAllocated() const;