pub mod heap_parameters;
pub mod vm_layout;
mod mmapper;
pub use self::mmapper::Mmapper;
mod byte_map_mmapper;
#[cfg(target_pointer_width = "64")]
mod fragmented_mapper;
mod map;
pub(crate) use self::map::CreateFreeListResult;
pub use self::map::VMMap;
use self::vm_layout::vm_layout;
mod map32;
#[cfg(target_pointer_width = "64")]
mod map64;
#[cfg(target_pointer_width = "32")]
pub fn create_vm_map() -> Box<dyn VMMap + Send + Sync> {
Box::new(map32::Map32::new())
}
#[cfg(target_pointer_width = "64")]
pub fn create_vm_map() -> Box<dyn VMMap + Send + Sync> {
if !vm_layout().force_use_contiguous_spaces {
Box::new(map32::Map32::new())
} else {
Box::new(map64::Map64::new())
}
}
#[cfg(target_pointer_width = "32")]
pub fn create_mmapper() -> Box<dyn Mmapper + Send + Sync> {
Box::new(byte_map_mmapper::ByteMapMmapper::new())
}
#[cfg(target_pointer_width = "64")]
pub fn create_mmapper() -> Box<dyn Mmapper + Send + Sync> {
Box::new(fragmented_mapper::FragmentedMapper::new())
}
use crate::util::Address;
use std::ops::Range;
pub fn heap_range() -> Range<Address> {
vm_layout().heap_start..vm_layout().heap_end
}
pub fn available_range() -> Range<Address> {
vm_layout().available_start()..vm_layout().available_end()
}