diff options
| author | 2024-11-30 01:34:44 +0000 | |
|---|---|---|
| committer | 2024-12-05 19:14:45 +0000 | |
| commit | 3fe3180b51a2a98731409fcd6bc7ff87b94c589b (patch) | |
| tree | 3df741528aa46422e7aece14d1f90015efbbc07c | |
| parent | 15f201a64033e4e40d55e339daadc26140167bd9 (diff) | |
Fix bump-pointer-space walk for black-dense
Also add post-gc heap-verification.
Bug: 343220989
Test: art/test/testrunner/testrunner.py --host --debug
Change-Id: I69878f81ad49994a6437f04e66eb8e607964340f
| -rw-r--r-- | runtime/gc/collector/mark_compact.cc | 2 | ||||
| -rw-r--r-- | runtime/gc/space/bump_pointer_space-walk-inl.h | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/runtime/gc/collector/mark_compact.cc b/runtime/gc/collector/mark_compact.cc index 1713e67120..a7af756970 100644 --- a/runtime/gc/collector/mark_compact.cc +++ b/runtime/gc/collector/mark_compact.cc @@ -787,6 +787,7 @@ void MarkCompact::RunPhases() { } } FinishPhase(); + GetHeap()->PostGcVerification(this); thread_running_gc_ = nullptr; } @@ -1061,6 +1062,7 @@ bool MarkCompact::PrepareForCompaction() { // We shouldn't be consuming more space after compaction than pre-compaction. CHECK_GE(black_objs_slide_diff_, 0); if (black_objs_slide_diff_ == 0) { + black_dense_end_ = black_allocations_begin_; return false; } for (size_t i = vector_len; i < vector_length_; i++) { diff --git a/runtime/gc/space/bump_pointer_space-walk-inl.h b/runtime/gc/space/bump_pointer_space-walk-inl.h index 38e02d5829..26402e8d3d 100644 --- a/runtime/gc/space/bump_pointer_space-walk-inl.h +++ b/runtime/gc/space/bump_pointer_space-walk-inl.h @@ -115,7 +115,7 @@ inline void BumpPointerSpace::Walk(Visitor&& visitor) { if (ptr > pos) { // Adjust block-size in case 'pos' is in the middle of the block. if (static_cast<ssize_t>(block_size) > ptr - pos) { - (*block_sizes_copy)[iter] -= ptr - pos; + (*block_sizes_copy)[iter] = ptr - pos; } break; } |