Skip to content

Commit

Permalink
Can't used checked cast here
Browse files Browse the repository at this point in the history
  • Loading branch information
earthling-amzn committed Oct 20, 2023
1 parent 9fcd5b9 commit e32f23d
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ bool ShenandoahYoungHeuristics::should_start_gc() {
// gets priority over old-gen marking.
ShenandoahHeap* heap = ShenandoahHeap::heap();

size_t promo_expedite_threshold = checked_cast<size_t>(percent_of(heap->young_generation()->max_capacity(), ShenandoahExpeditePromotionsThreshold));
size_t promo_expedite_threshold = percent_of(heap->young_generation()->max_capacity(), ShenandoahExpeditePromotionsThreshold);
size_t promo_potential = heap->get_promotion_potential();
if (promo_potential > promo_expedite_threshold) {
// Detect unsigned arithmetic underflow
Expand All @@ -152,8 +152,8 @@ bool ShenandoahYoungHeuristics::should_start_gc() {
if (mixed_candidates > ShenandoahExpediteMixedThreshold && !heap->is_concurrent_weak_root_in_progress()) {
// We need to run young GC in order to open up some free heap regions so we can finish mixed evacuations.
// If concurrent weak root processing is in progress, it means the old cycle has chosen mixed collection
// candidates, but has not completed. There is no point in evaluating the trigger before the young cycle
// will be able to start.
// candidates, but has not completed. There is no point in trying to start the young cycle before the old
// cycle completes.
log_info(gc)("Trigger (%s): expedite mixed evacuation of " SIZE_FORMAT " regions",
_space_info->name(), mixed_candidates);
return true;
Expand Down

0 comments on commit e32f23d

Please sign in to comment.