diff options
| author | 2014-08-19 00:44:50 +0000 | |
|---|---|---|
| committer | 2014-08-18 21:31:43 +0000 | |
| commit | 562f0ef60bb1498fdf3c43fe747ba067ffe6ebed (patch) | |
| tree | be357c470af88e29f54a5842ec6c136589675b49 | |
| parent | 7df1754ae17acd891995159fc50f3bb176b770dd (diff) | |
| parent | d35326fc45ef71d88b82fd5fe6875ae07f3646cb (diff) | |
Merge "Fix heap corruption and verification."
| -rw-r--r-- | runtime/gc/accounting/card_table-inl.h | 2 | ||||
| -rw-r--r-- | runtime/gc/heap.cc | 4 |
2 files changed, 2 insertions, 4 deletions
diff --git a/runtime/gc/accounting/card_table-inl.h b/runtime/gc/accounting/card_table-inl.h index 217360f21d..3b06f74d72 100644 --- a/runtime/gc/accounting/card_table-inl.h +++ b/runtime/gc/accounting/card_table-inl.h @@ -55,7 +55,7 @@ inline size_t CardTable::Scan(ContinuousSpaceBitmap* bitmap, byte* scan_begin, b // scan_end is the byte after the last byte we scan. DCHECK_LE(scan_end, reinterpret_cast<byte*>(bitmap->HeapLimit())); byte* card_cur = CardFromAddr(scan_begin); - byte* card_end = CardFromAddr(scan_end); + byte* card_end = CardFromAddr(AlignUp(scan_end, kCardSize)); CheckCardValid(card_cur); CheckCardValid(card_end); size_t cards_scanned = 0; diff --git a/runtime/gc/heap.cc b/runtime/gc/heap.cc index 5d138d231c..821d22fb47 100644 --- a/runtime/gc/heap.cc +++ b/runtime/gc/heap.cc @@ -2483,7 +2483,6 @@ class VerifyLiveStackReferences { bool Heap::VerifyMissingCardMarks() { Thread* self = Thread::Current(); Locks::mutator_lock_->AssertExclusiveHeld(self); - // We need to sort the live stack since we binary search it. live_stack_->Sort(); // Since we sorted the allocation stack content, need to revoke all @@ -2491,7 +2490,6 @@ bool Heap::VerifyMissingCardMarks() { RevokeAllThreadLocalAllocationStacks(self); VerifyLiveStackReferences visitor(this); GetLiveBitmap()->Visit(visitor); - // We can verify objects in the live stack since none of these should reference dead objects. for (mirror::Object** it = live_stack_->Begin(); it != live_stack_->End(); ++it) { if (!kUseThreadLocalAllocationStack || *it != nullptr) { @@ -2689,7 +2687,7 @@ void Heap::PostGcVerificationPaused(collector::GarbageCollector* gc) { void Heap::PostGcVerification(collector::GarbageCollector* gc) { if (verify_system_weaks_ || verify_post_gc_rosalloc_ || verify_post_gc_heap_) { collector::GarbageCollector::ScopedPause pause(gc); - PreGcVerificationPaused(gc); + PostGcVerificationPaused(gc); } } |