Commit cc3210e 1 parent bf5794b commit cc3210e Copy full SHA for cc3210e
File tree 2 files changed +4
-3
lines changed
2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ impl<VM: VMBinding> CommonGenPlan<VM> {
47
47
args. global_args
48
48
. options
49
49
. nursery
50
- . estimate_virtual_memory_in_pages ( ) ,
50
+ . estimate_virtual_memory_in_bytes ( ) ,
51
51
false ,
52
52
) ,
53
53
) ,
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ use std::str::FromStr;
7
7
use strum_macros:: EnumString ;
8
8
9
9
use super :: conversions;
10
+ use super :: heap:: vm_layout:: BYTES_IN_CHUNK ;
10
11
11
12
/// The default stress factor. This is set to the max usize,
12
13
/// which means we will never trigger a stress GC for the default value.
@@ -432,15 +433,15 @@ pub enum NurserySize {
432
433
433
434
impl NurserySize {
434
435
/// 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 {
436
437
let virtual_memory_bytes = match * self {
437
438
NurserySize :: Bounded { min : _, max } => max,
438
439
// Just use the default max nursery size -- the nursery won't get larger than that.
439
440
// See get_max_nursery_bytes()
440
441
NurserySize :: ProportionalBounded { min : _, max : _ } => DEFAULT_MAX_NURSERY ,
441
442
NurserySize :: Fixed ( sz) => sz,
442
443
} ;
443
- conversions:: bytes_to_pages_up ( virtual_memory_bytes)
444
+ conversions:: raw_align_up ( virtual_memory_bytes, BYTES_IN_CHUNK )
444
445
}
445
446
446
447
/// Return true if the values are valid.
You can’t perform that action at this time.
0 commit comments