Fix valgrind gtests and memory leaks.
All tests pass other than image_test which passes if some bad reads
are disabled (buzbee working on this).
Change-Id: Ifd6b6e3aed0bc867703b6e818353a9f296609422
diff --git a/runtime/gc/allocator/rosalloc.cc b/runtime/gc/allocator/rosalloc.cc
index e86bee6..e13bd71 100644
--- a/runtime/gc/allocator/rosalloc.cc
+++ b/runtime/gc/allocator/rosalloc.cc
@@ -93,6 +93,12 @@
}
}
+RosAlloc::~RosAlloc() {
+ for (size_t i = 0; i < kNumOfSizeBrackets; i++) {
+ delete size_bracket_locks_[i];
+ }
+}
+
void* RosAlloc::AllocPages(Thread* self, size_t num_pages, byte page_map_type) {
lock_.AssertHeld(self);
DCHECK(page_map_type == kPageMapRun || page_map_type == kPageMapLargeObject);