[][src]Struct polymorph_allocator::region::Region

#[repr(C)]
pub struct Region {
    pub size: usize,
    pub data: usize,
    pub padding_start: usize,
    pub padding_end: usize,
    pub flags: RegionFlags,
    pub prev: usize,
    pub next: usize,
}

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 regoin preceding this one

next: usize

Address of the header of the memory region following this one

Methods

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]

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

impl Debug for Region[src]

Auto Trait Implementations

impl Unpin for Region

impl Send for Region

impl Sync for Region

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]