Free Arenas from the ArenaStack before running codegen.
Since the ArenaStack is used only by the MIRGraph and not by
the memory hungry codegen, freeing the ArenaStack's Arenas
just before running the codegen should reduce the compiler's
peak memory usage.
Bug: 13564922
Change-Id: I1cb49d367e4e81d71a03cac89b3739ed61e4f966
diff --git a/compiler/utils/scoped_arena_allocator.h b/compiler/utils/scoped_arena_allocator.h
index 24a8afe..28e86ec 100644
--- a/compiler/utils/scoped_arena_allocator.h
+++ b/compiler/utils/scoped_arena_allocator.h
@@ -37,6 +37,8 @@
explicit ArenaStack(ArenaPool* arena_pool);
~ArenaStack();
+ void Reset();
+
size_t PeakBytesAllocated() {
return PeakStats()->BytesAllocated();
}