pub struct SpaceAllocator<'a> { /* private fields */ }Expand description
Allocator for in-file and in-memory space.
Allocates sections, segments and raw space.
Implementations§
Source§impl<'a> SpaceAllocator<'a>
impl<'a> SpaceAllocator<'a>
Sourcepub fn new(
class: Class,
page_size: u64,
sections: &[Section],
segments: &'a mut Vec<Segment>,
) -> Self
pub fn new( class: Class, page_size: u64, sections: &[Section], segments: &'a mut Vec<Segment>, ) -> Self
Create new allocator for the specified sections and segments.
Sourcepub fn allocate_section(self, section: &mut Section) -> Result<(), Error>
pub fn allocate_section(self, section: &mut Section) -> Result<(), Error>
Allocate in-file and in-memory space for the specified ALLOC section.
On success sets Section::offset and Section::virtual_address.
Sourcepub fn allocate_segment(self, segment: &mut Segment) -> Result<(), Error>
pub fn allocate_segment(self, segment: &mut Segment) -> Result<(), Error>
Allocate in-file and in-memory space for the specified LOAD segment.
On success sets Segment::offset, Segment::virtual_address and
Segment::physical_address.
Trait Implementations§
Source§impl<'a> Debug for SpaceAllocator<'a>
impl<'a> Debug for SpaceAllocator<'a>
Auto Trait Implementations§
impl<'a> Freeze for SpaceAllocator<'a>
impl<'a> RefUnwindSafe for SpaceAllocator<'a>
impl<'a> Send for SpaceAllocator<'a>
impl<'a> Sync for SpaceAllocator<'a>
impl<'a> Unpin for SpaceAllocator<'a>
impl<'a> !UnwindSafe for SpaceAllocator<'a>
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