Create a scoped arena allocator and use that for LVN.
This saves more than 0.5s of boot.oat compilation time
on Nexus 5.
TODO: Move other stuff to the scoped allocator. This CL
alone increases the peak memory allocation. By reusing
the memory for other parts of the compilation we should
reduce this overhead.
Change-Id: Ifbc00aab4f3afd0000da818dfe68b96713824a08
diff --git a/compiler/utils/arena_bit_vector.cc b/compiler/utils/arena_bit_vector.cc
index 220ff14..eff9778 100644
--- a/compiler/utils/arena_bit_vector.cc
+++ b/compiler/utils/arena_bit_vector.cc
@@ -25,13 +25,13 @@
~ArenaBitVectorAllocator() {}
virtual void* Alloc(size_t size) {
- return arena_->Alloc(size, ArenaAllocator::kAllocGrowableBitMap);
+ return arena_->Alloc(size, kArenaAllocGrowableBitMap);
}
virtual void Free(void*) {} // Nop.
static void* operator new(size_t size, ArenaAllocator* arena) {
- return arena->Alloc(sizeof(ArenaBitVectorAllocator), ArenaAllocator::kAllocGrowableBitMap);
+ return arena->Alloc(sizeof(ArenaBitVectorAllocator), kArenaAllocGrowableBitMap);
}
static void operator delete(void* p) {} // Nop.