pub struct AddressSpaceLayout {
pub page_size: usize,
pub address_space_size: usize,
pub stack_region: MemoryRegion,
pub heap_region: MemoryRegion,
pub arch_constraints: ArchConstraints,
}
Expand description
Address space layout detection and management.
Fields§
§page_size: usize
Page size for alignment
address_space_size: usize
Available address space size
stack_region: MemoryRegion
Stack region boundaries
heap_region: MemoryRegion
Heap region boundaries
arch_constraints: ArchConstraints
Architecture-specific constraints
Implementations§
Source§impl AddressSpaceLayout
impl AddressSpaceLayout
Sourcepub fn available_entropy_bits(&self) -> u32
pub fn available_entropy_bits(&self) -> u32
Get available entropy bits for randomization.
Sourcepub fn max_stack_offset(&self, stack_size: usize) -> usize
pub fn max_stack_offset(&self, stack_size: usize) -> usize
Get maximum stack offset for randomization.
Sourcepub fn max_heap_offset(&self, heap_size: usize) -> usize
pub fn max_heap_offset(&self, heap_size: usize) -> usize
Get maximum heap offset for randomization.
Sourcepub fn is_valid_stack_address(&self, address: usize, size: usize) -> bool
pub fn is_valid_stack_address(&self, address: usize, size: usize) -> bool
Check if stack address is valid.
Sourcepub fn is_valid_heap_address(&self, address: usize, size: usize) -> bool
pub fn is_valid_heap_address(&self, address: usize, size: usize) -> bool
Check if heap address is valid.
Sourcepub fn stack_base_address(&self) -> usize
pub fn stack_base_address(&self) -> usize
Get stack base address for allocation.
Sourcepub fn heap_base_address(&self) -> usize
pub fn heap_base_address(&self) -> usize
Get heap base address for allocation.
Trait Implementations§
Source§impl Clone for AddressSpaceLayout
impl Clone for AddressSpaceLayout
Source§fn clone(&self) -> AddressSpaceLayout
fn clone(&self) -> AddressSpaceLayout
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for AddressSpaceLayout
impl RefUnwindSafe for AddressSpaceLayout
impl Send for AddressSpaceLayout
impl Sync for AddressSpaceLayout
impl Unpin for AddressSpaceLayout
impl UnwindSafe for AddressSpaceLayout
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more