From ce54e38d5cfd6b9e3614a138d3a1d2865d4488ec Mon Sep 17 00:00:00 2001 From: Kelvin Nilsen Date: Fri, 16 Jan 2026 15:40:01 +0000 Subject: [PATCH] Fix compile errors following merge from master But there are still many correctness failures following this merge. Still debugging. --- .../gc/shenandoah/heuristics/shenandoahAdaptiveHeuristics.cpp | 2 +- src/hotspot/share/gc/shenandoah/shenandoahFreeSet.hpp | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/hotspot/share/gc/shenandoah/heuristics/shenandoahAdaptiveHeuristics.cpp b/src/hotspot/share/gc/shenandoah/heuristics/shenandoahAdaptiveHeuristics.cpp index 7d8afea767a..720d2553728 100644 --- a/src/hotspot/share/gc/shenandoah/heuristics/shenandoahAdaptiveHeuristics.cpp +++ b/src/hotspot/share/gc/shenandoah/heuristics/shenandoahAdaptiveHeuristics.cpp @@ -182,7 +182,7 @@ void ShenandoahAdaptiveHeuristics::resume_idle_span() { // There is no headroom during evacuation and update refs. This information is not used to trigger the next GC. // In future implementations, this information may feed into worker surge calculations. void ShenandoahAdaptiveHeuristics::start_evac_span() { - size_t mutator_available = _free_set->capacity() - _free_set->used(); + size_t mutator_available = _free_set->available_holding_lock(); _trigger_threshold = mutator_available; } diff --git a/src/hotspot/share/gc/shenandoah/shenandoahFreeSet.hpp b/src/hotspot/share/gc/shenandoah/shenandoahFreeSet.hpp index a016a598794..f7d64696763 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahFreeSet.hpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahFreeSet.hpp @@ -845,11 +845,14 @@ public: ShenandoahRebuildLocker locker(rebuild_lock()); return _partitions.used_by(ShenandoahFreeSetPartitionId::Mutator); } + inline size_t reserved() const { return _partitions.capacity_of(ShenandoahFreeSetPartitionId::Collector); } inline size_t available() { shenandoah_assert_not_heaplocked(); ShenandoahRebuildLocker locker(rebuild_lock()); return _partitions.available_in_locked_for_rebuild(ShenandoahFreeSetPartitionId::Mutator); } + inline size_t available_holding_lock() const + { return _partitions.available_in(ShenandoahFreeSetPartitionId::Mutator); } inline size_t total_humongous_waste() const { return _total_humongous_waste; } inline size_t humongous_waste_in_mutator() const { return _partitions.humongous_waste(ShenandoahFreeSetPartitionId::Mutator); }