[K/N] Fix GC stats reporting sweep in wrong epoch ^KT-55364
Co-authored-by: Troels Lund <troels@google.com> Merge-request: KOTLIN-MR-696 Merged-by: Alexander Shabalin <alexander.shabalin@jetbrains.com>
This commit is contained in:
committed by
Space Cloud
parent
2fc5316c1b
commit
99e4ca65be
@@ -37,7 +37,7 @@ class alignas(8) ExtraObjectPage {
|
|||||||
public:
|
public:
|
||||||
using GCSweepScope = gc::GCHandle::GCSweepExtraObjectsScope;
|
using GCSweepScope = gc::GCHandle::GCSweepExtraObjectsScope;
|
||||||
|
|
||||||
static GCSweepScope currentGCSweepScope() noexcept { return gc::GCHandle::currentEpoch()->sweepExtraObjects(); }
|
static GCSweepScope currentGCSweepScope(gc::GCHandle& handle) noexcept { return handle.sweepExtraObjects(); }
|
||||||
|
|
||||||
static ExtraObjectPage* Create(uint32_t ignored) noexcept;
|
static ExtraObjectPage* Create(uint32_t ignored) noexcept;
|
||||||
|
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ class alignas(8) FixedBlockPage {
|
|||||||
public:
|
public:
|
||||||
using GCSweepScope = gc::GCHandle::GCSweepScope;
|
using GCSweepScope = gc::GCHandle::GCSweepScope;
|
||||||
|
|
||||||
static GCSweepScope currentGCSweepScope() noexcept { return gc::GCHandle::currentEpoch()->sweep(); }
|
static GCSweepScope currentGCSweepScope(gc::GCHandle& handle) noexcept { return handle.sweep(); }
|
||||||
|
|
||||||
static FixedBlockPage* Create(uint32_t blockSize) noexcept;
|
static FixedBlockPage* Create(uint32_t blockSize) noexcept;
|
||||||
|
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ class alignas(8) NextFitPage {
|
|||||||
public:
|
public:
|
||||||
using GCSweepScope = gc::GCHandle::GCSweepScope;
|
using GCSweepScope = gc::GCHandle::GCSweepScope;
|
||||||
|
|
||||||
static GCSweepScope currentGCSweepScope() noexcept { return gc::GCHandle::currentEpoch()->sweep(); }
|
static GCSweepScope currentGCSweepScope(gc::GCHandle& handle) noexcept { return handle.sweep(); }
|
||||||
|
|
||||||
static NextFitPage* Create(uint32_t cellCount) noexcept;
|
static NextFitPage* Create(uint32_t cellCount) noexcept;
|
||||||
|
|
||||||
|
|||||||
@@ -48,9 +48,10 @@ public:
|
|||||||
used_.Push(page);
|
used_.Push(page);
|
||||||
return page;
|
return page;
|
||||||
}
|
}
|
||||||
|
auto handle = gc::GCHandle::currentEpoch();
|
||||||
if ((page = unswept_.Pop())) {
|
if ((page = unswept_.Pop())) {
|
||||||
// If there're unswept_ pages, the GC is in progress.
|
// If there're unswept_ pages, the GC is in progress.
|
||||||
GCSweepScope sweepHandle = T::currentGCSweepScope();
|
GCSweepScope sweepHandle = T::currentGCSweepScope(*handle);
|
||||||
if ((page = SweepSingle(sweepHandle, page, unswept_, used_, finalizerQueue))) {
|
if ((page = SweepSingle(sweepHandle, page, unswept_, used_, finalizerQueue))) {
|
||||||
return page;
|
return page;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ class alignas(8) SingleObjectPage {
|
|||||||
public:
|
public:
|
||||||
using GCSweepScope = gc::GCHandle::GCSweepScope;
|
using GCSweepScope = gc::GCHandle::GCSweepScope;
|
||||||
|
|
||||||
static GCSweepScope currentGCSweepScope() noexcept { return gc::GCHandle::currentEpoch()->sweep(); }
|
static GCSweepScope currentGCSweepScope(gc::GCHandle& handle) noexcept { return handle.sweep(); }
|
||||||
|
|
||||||
static SingleObjectPage* Create(uint64_t cellCount) noexcept;
|
static SingleObjectPage* Create(uint64_t cellCount) noexcept;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user