GC data structures allocation tracking

Adds a new stl compatible allocator that is used in most GC data
structures. When the data structures allocate and free memory, it
lets the heap know of how much memory was allocated or freed. Using
this info, we dump the approximated stl data structures memory usage
when a sigquit occurs.

The allocation tracking can be disabled with a compile time boolean
flag to remove performance impact.

Change-Id: Idddb6713169e07be913bceeb50f305c8573e4392
diff --git a/runtime/gc/heap.h b/runtime/gc/heap.h
index 4a043a7..853db93 100644
--- a/runtime/gc/heap.h
+++ b/runtime/gc/heap.h
@@ -24,6 +24,7 @@
 #include "atomic_integer.h"
 #include "base/timing_logger.h"
 #include "gc/accounting/atomic_stack.h"
+#include "gc/accounting/gc_allocator.h"
 #include "gc/accounting/card_table.h"
 #include "gc/collector/gc_type.h"
 #include "globals.h"
@@ -207,6 +208,10 @@
     return target_utilization_;
   }
 
+  // Data structure memory usage tracking.
+  void RegisterGCAllocation(size_t bytes);
+  void RegisterGCDeAllocation(size_t bytes);
+
   // Set target ideal heap utilization ratio, implements
   // dalvik.system.VMRuntime.setTargetHeapUtilization.
   void SetTargetHeapUtilization(float target);
@@ -556,6 +561,9 @@
   // Current process state, updated by activity manager.
   ProcessState process_state_;
 
+  // Data structure GC overhead.
+  AtomicInteger gc_memory_overhead_;
+
   // Heap verification flags.
   const bool verify_missing_card_marks_;
   const bool verify_system_weaks_;