[−][src]Struct polymorph_allocator::Region
Header of a memory region.
Fields
size: usize
Available size of the memory region (excluding the size of the header).
data: usize
Starting address of this memory region's data
padding_start: usize
Number of bytes of padding to place at the start of the region
padding_end: usize
Number of bytes of padding to place at the end of the region
flags: RegionFlags
Flags for this memory region
prev: usize
Address of the header of the memory region preceding this one
next: usize
Address of the header of the memory region following this one
Implementations
impl Region
[src]
pub fn new(addr: usize, size: usize) -> Region
[src]
Creates a new Region with the given addr
and size
.
pub fn new_with_padding(
addr: usize,
size: usize,
padding_start: usize,
padding_end: usize
) -> Region
[src]
addr: usize,
size: usize,
padding_start: usize,
padding_end: usize
) -> Region
Creates a new Region with the given addr
and size
, and also sets
the start and end padding of the region.
pub fn min_size() -> usize
[src]
The minimum size of a memory region.
pub fn get_used(&self) -> bool
[src]
Returns whether or not this memory region is in use
pub fn set_used(&mut self, used: bool)
[src]
Sets the in use flag of this memory region to the value given in
used
.
pub fn size(&self) -> usize
[src]
Returns the total size, including padding, of this memory region
pub unsafe fn header_ptr(&self) -> Option<NonNull<u8>>
[src]
Returns a raw pointer to this memory region's header
pub unsafe fn data_ptr(&self) -> Option<NonNull<u8>>
[src]
Returns a raw pointer to the data of this memory region
Trait Implementations
Auto Trait Implementations
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,