Clean up Scoped-/ArenaAlocator array allocations.
Change-Id: Id718f8a4450adf1608306286fa4e6b9194022532
diff --git a/compiler/utils/arena_allocator.h b/compiler/utils/arena_allocator.h
index 7f5bc9a..e730fd7 100644
--- a/compiler/utils/arena_allocator.h
+++ b/compiler/utils/arena_allocator.h
@@ -176,7 +176,7 @@
ArenaAllocatorAdapter<void> Adapter(ArenaAllocKind kind = kArenaAllocSTL);
// Returns zeroed memory.
- void* Alloc(size_t bytes, ArenaAllocKind kind) ALWAYS_INLINE {
+ void* Alloc(size_t bytes, ArenaAllocKind kind = kArenaAllocMisc) ALWAYS_INLINE {
if (UNLIKELY(running_on_valgrind_)) {
return AllocValgrind(bytes, kind);
}
@@ -194,8 +194,9 @@
return ret;
}
- template <typename T> T* AllocArray(size_t length) {
- return static_cast<T*>(Alloc(length * sizeof(T), kArenaAllocMisc));
+ template <typename T>
+ T* AllocArray(size_t length, ArenaAllocKind kind = kArenaAllocMisc) {
+ return static_cast<T*>(Alloc(length * sizeof(T), kind));
}
void* AllocValgrind(size_t bytes, ArenaAllocKind kind);