mmtk/util/heap/layout/
mod.rs1pub mod heap_parameters;
2pub mod vm_layout;
3
4mod mmapper;
5pub use self::mmapper::Mmapper;
6
7mod map;
8pub(crate) use self::map::CreateFreeListResult;
9pub use self::map::VMMap;
10use self::vm_layout::vm_layout;
11mod map32;
12#[cfg(target_pointer_width = "64")]
13mod map64;
14
15#[cfg(target_pointer_width = "32")]
16pub fn create_vm_map() -> Box<dyn VMMap + Send + Sync> {
17 Box::new(map32::Map32::new())
18}
19
20#[cfg(target_pointer_width = "64")]
21pub fn create_vm_map() -> Box<dyn VMMap + Send + Sync> {
22 if !vm_layout().force_use_contiguous_spaces {
23 Box::new(map32::Map32::new())
24 } else {
25 Box::new(map64::Map64::new())
26 }
27}
28
29pub fn create_mmapper() -> Box<dyn Mmapper> {
30 use crate::util::heap::layout::mmapper::csm::ChunkStateMmapper;
34 Box::new(ChunkStateMmapper::new())
35}
36
37use crate::util::Address;
38use std::ops::Range;
39
40pub fn heap_range() -> Range<Address> {
45 vm_layout().heap_start..vm_layout().heap_end
46}
47
48pub fn available_range() -> Range<Address> {
51 vm_layout().available_start()..vm_layout().available_end()
52}