Improve heap verification for invalid roots.
The new root verification prints the root type and owner thread id as
well as the type of the object.
Also a bit of work for planned multi-threaded verification.
Bug: 14289301
Change-Id: Ia73c517dc11ec6dd82f3d945604ee3836b3db536
diff --git a/runtime/gc/heap.h b/runtime/gc/heap.h
index eea2879..6fe0dcf 100644
--- a/runtime/gc/heap.h
+++ b/runtime/gc/heap.h
@@ -109,8 +109,6 @@
};
std::ostream& operator<<(std::ostream& os, const ProcessState& process_state);
-std::ostream& operator<<(std::ostream& os, const RootType& root_type);
-
class Heap {
public:
// If true, measure the total allocation time.
@@ -218,7 +216,8 @@
// Check sanity of all live references.
void VerifyHeap() LOCKS_EXCLUDED(Locks::heap_bitmap_lock_);
- bool VerifyHeapReferences(bool verify_referents = true)
+ // Returns how many failures occured.
+ size_t VerifyHeapReferences(bool verify_referents = true)
EXCLUSIVE_LOCKS_REQUIRED(Locks::heap_bitmap_lock_, Locks::mutator_lock_);
bool VerifyMissingCardMarks()
EXCLUSIVE_LOCKS_REQUIRED(Locks::heap_bitmap_lock_, Locks::mutator_lock_);