Skip to content

Commit c7e2286

Browse files
committed
Fix special case for compressed pointer
1 parent cc3210e commit c7e2286

File tree

2 files changed

+11
-12
lines changed

2 files changed

+11
-12
lines changed

src/plan/generational/mod.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,8 @@ pub const GEN_CONSTRAINTS: PlanConstraints = PlanConstraints {
4848
barrier: ACTIVE_BARRIER,
4949
// We may trace duplicate edges in sticky immix (or any plan that uses object remembering barrier). See https://github.com/mmtk/mmtk-core/issues/743.
5050
may_trace_duplicate_edges: ACTIVE_BARRIER.equals(BarrierSelector::ObjectBarrier),
51-
max_non_los_default_alloc_bytes: crate::util::rust_util::min_of_usize(
51+
max_non_los_default_alloc_bytes:
5252
crate::plan::plan_constraints::MAX_NON_LOS_ALLOC_BYTES_COPYING_PLAN,
53-
crate::util::options::NURSERY_SIZE,
54-
),
5553
needs_prepare_mutator: false,
5654
..PlanConstraints::default()
5755
};

src/util/options.rs

+10-9
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,6 @@ impl FromStr for PerfEventOptions {
9898
}
9999
}
100100

101-
/// The default nursery space size.
102-
#[cfg(target_pointer_width = "64")]
103-
pub const NURSERY_SIZE: usize = (1 << 20) << LOG_BYTES_IN_MBYTE;
104101
/// The default min nursery size. This does not affect the actual space we create as nursery. It is
105102
/// only used in the GC trigger check.
106103
#[cfg(target_pointer_width = "64")]
@@ -110,17 +107,16 @@ pub const DEFAULT_MIN_NURSERY: usize = 20 << LOG_BYTES_IN_MBYTE;
110107
#[cfg(target_pointer_width = "64")]
111108
pub const DEFAULT_MAX_NURSERY: usize = (1 << 20) << LOG_BYTES_IN_MBYTE;
112109

113-
/// The default nursery space size.
114-
#[cfg(target_pointer_width = "32")]
115-
pub const NURSERY_SIZE: usize = 32 << LOG_BYTES_IN_MBYTE;
116110
/// The default min nursery size. This does not affect the actual space we create as nursery. It is
117111
/// only used in the GC trigger check.
118112
#[cfg(target_pointer_width = "32")]
119113
pub const DEFAULT_MIN_NURSERY: usize = 2 << LOG_BYTES_IN_MBYTE;
114+
/// The default max nursery size for 32 bits.
115+
pub const DEFAULT_MAX_NURSERY_32: usize = 32 << LOG_BYTES_IN_MBYTE;
120116
/// The default max nursery size. This does not affect the actual space we create as nursery. It is
121117
/// only used in the GC trigger check.
122118
#[cfg(target_pointer_width = "32")]
123-
pub const DEFAULT_MAX_NURSERY: usize = 32 << LOG_BYTES_IN_MBYTE;
119+
pub const DEFAULT_MAX_NURSERY: usize = DEFAULT_MAX_NURSERY_32;
124120

125121
/// The default min nursery size proportional to the current heap size
126122
pub const DEFAULT_PROPORTIONAL_MIN_NURSERY: f64 = 0.2;
@@ -437,8 +433,13 @@ impl NurserySize {
437433
let virtual_memory_bytes = match *self {
438434
NurserySize::Bounded { min: _, max } => max,
439435
// Just use the default max nursery size -- the nursery won't get larger than that.
440-
// See get_max_nursery_bytes()
441-
NurserySize::ProportionalBounded { min: _, max: _ } => DEFAULT_MAX_NURSERY,
436+
NurserySize::ProportionalBounded { min: _, max: _ } => {
437+
if !crate::util::heap::vm_layout::vm_layout().force_use_contiguous_spaces {
438+
DEFAULT_MAX_NURSERY_32
439+
} else {
440+
DEFAULT_MAX_NURSERY
441+
}
442+
}
442443
NurserySize::Fixed(sz) => sz,
443444
};
444445
conversions::raw_align_up(virtual_memory_bytes, BYTES_IN_CHUNK)

0 commit comments

Comments
 (0)