From 3fe3180b51a2a98731409fcd6bc7ff87b94c589b Mon Sep 17 00:00:00 2001 From: Lokesh Gidra Date: Sat, 30 Nov 2024 01:34:44 +0000 Subject: 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 --- runtime/gc/collector/mark_compact.cc | 2 ++ runtime/gc/space/bump_pointer_space-walk-inl.h | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) 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(block_size) > ptr - pos) { - (*block_sizes_copy)[iter] -= ptr - pos; + (*block_sizes_copy)[iter] = ptr - pos; } break; } -- cgit v1.2.3-59-g8ed1b