From bc7b1094c320dab27bf67da4f6f54e605a97feb5 Mon Sep 17 00:00:00 2001 From: Troels Bjerre Lund Date: Fri, 12 May 2023 09:24:16 +0000 Subject: [PATCH] K/N custom-alloc: Fix GC stats for NextFitPage ^KT-55364 Swept and kept objects in NextFitPages are double counted; first in GCApi::SweepObject and then again inside NextFitPage::Sweep. This fix removes the latter. Co-authored-by: Troels Lund Merge-request: KOTLIN-MR-691 Merged-by: Alexander Shabalin --- kotlin-native/runtime/src/custom_alloc/cpp/NextFitPage.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/kotlin-native/runtime/src/custom_alloc/cpp/NextFitPage.cpp b/kotlin-native/runtime/src/custom_alloc/cpp/NextFitPage.cpp index 0b075c953e8..fb08351a9b5 100644 --- a/kotlin-native/runtime/src/custom_alloc/cpp/NextFitPage.cpp +++ b/kotlin-native/runtime/src/custom_alloc/cpp/NextFitPage.cpp @@ -47,10 +47,8 @@ bool NextFitPage::Sweep(GCSweepScope& sweepHandle, FinalizerQueue& finalizerQueu if (block->isAllocated_) { if (SweepObject(block->data_, finalizerQueue, sweepHandle)) { alive = true; - sweepHandle.addKeptObject(); } else { block->Deallocate(); - sweepHandle.addSweptObject(); } } }