Skip to content

Commit cc3210e

Browse files
committed
VMRequest for the copying nursery should be bytes
1 parent bf5794b commit cc3210e

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/plan/generational/global.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ impl<VM: VMBinding> CommonGenPlan<VM> {
4747
args.global_args
4848
.options
4949
.nursery
50-
.estimate_virtual_memory_in_pages(),
50+
.estimate_virtual_memory_in_bytes(),
5151
false,
5252
),
5353
),

src/util/options.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ use std::str::FromStr;
77
use strum_macros::EnumString;
88

99
use super::conversions;
10+
use super::heap::vm_layout::BYTES_IN_CHUNK;
1011

1112
/// The default stress factor. This is set to the max usize,
1213
/// which means we will never trigger a stress GC for the default value.
@@ -432,15 +433,15 @@ pub enum NurserySize {
432433

433434
impl NurserySize {
434435
/// Estimate the virtual memory needed for the nursery space. This is used during space creation.
435-
pub fn estimate_virtual_memory_in_pages(&self) -> usize {
436+
pub fn estimate_virtual_memory_in_bytes(&self) -> usize {
436437
let virtual_memory_bytes = match *self {
437438
NurserySize::Bounded { min: _, max } => max,
438439
// Just use the default max nursery size -- the nursery won't get larger than that.
439440
// See get_max_nursery_bytes()
440441
NurserySize::ProportionalBounded { min: _, max: _ } => DEFAULT_MAX_NURSERY,
441442
NurserySize::Fixed(sz) => sz,
442443
};
443-
conversions::bytes_to_pages_up(virtual_memory_bytes)
444+
conversions::raw_align_up(virtual_memory_bytes, BYTES_IN_CHUNK)
444445
}
445446

446447
/// Return true if the values are valid.

0 commit comments

Comments
 (0)