pub struct Regions {
pub stack_pages: u32,
pub ro_pages: u32,
pub rw_pages: u32,
pub heap_pages: u32,
}Expand description
Data-region geometry: the page count of each of the four fixed
regions. Placement is derived, not stored — regions stack linearly
from DATA_BASE in the order stack, ro, rw, heap, so the page
counts alone determine every base address.
A region with zero pages is omitted from Regions::iter entirely
and occupies no address space.
Fields§
§stack_pages: u32§ro_pages: u32§rw_pages: u32§heap_pages: u32Implementations§
Source§impl Regions
impl Regions
Sourcepub fn iter(&self) -> impl Iterator<Item = Region> + '_
pub fn iter(&self) -> impl Iterator<Item = Region> + '_
Iterate every non-empty region in address (and RegionKind)
order: stack, ro?, rw?, heap?.
Consumers that pack a content-addressed arena in insertion order depend on this order being stable; do not reorder it.
Sourcepub fn get(&self, kind: RegionKind) -> Option<Region>
pub fn get(&self, kind: RegionKind) -> Option<Region>
Look up one region by kind, or None if it is empty.
Sourcepub const fn stack_top(&self) -> u64
pub const fn stack_top(&self) -> u64
Top-of-stack address (initial SP). RISC-V SP grows downward, so
the first push lands at stack_top - 8.
Sourcepub const fn total_pages(&self) -> u32
pub const fn total_pages(&self) -> u32
Total pages across all regions.
Sourcepub const fn data_extent(&self) -> u64
pub const fn data_extent(&self) -> u64
Total data length in bytes, i.e. the size of the flat memory
image a runtime must materialize at DATA_BASE.