pub struct MemoryRegion {
pub start: VirtualAddress,
pub end: VirtualAddress,
pub region_type: MemoryRegionType,
pub flags: PageFlags,
pub physical_pages: Option<Vec<PhysicalAddress>>,
pub file_mapping: Option<FileMapping>,
}Expand description
Memory region in a process’s address space
Fields§
§start: VirtualAddressStarting virtual address
end: VirtualAddressEnding virtual address (exclusive)
region_type: MemoryRegionTypeRegion type
flags: PageFlagsAccess permissions
physical_pages: Option<Vec<PhysicalAddress>>Physical pages backing this region (if any)
file_mapping: Option<FileMapping>File mapping info (if mapped file)
Implementations§
Source§impl MemoryRegion
impl MemoryRegion
Sourcepub fn new(
start: VirtualAddress,
size: usize,
region_type: MemoryRegionType,
flags: PageFlags,
) -> Self
pub fn new( start: VirtualAddress, size: usize, region_type: MemoryRegionType, flags: PageFlags, ) -> Self
Create a new memory region
Sourcepub fn contains(&self, addr: VirtualAddress) -> bool
pub fn contains(&self, addr: VirtualAddress) -> bool
Check if address is within this region
Sourcepub fn overlaps(&self, other: &MemoryRegion) -> bool
pub fn overlaps(&self, other: &MemoryRegion) -> bool
Check if region overlaps with another