Struct switcheroo::stack::EightMbStack[][src]

pub struct EightMbStack(_);

A 8 Mb Stack.

On Unix platforms this will simply reserve 8 Mb of memory to be used as a stack (without a guard page). Mmap will be called with the MAP_NORESERVE flag to allow us to overcommit on stack allocations.

On Windows it will reserve 8 Mb of memory + 4 pages on top for the exception handler. Only the bottom of the stack will be marked as commited, while the rest will be reserved. This allows us to overcommit on stack allocations. The memory is specifically set up with guard pages in a way that Windows expect it to be, so that the OS can automatically grow and commit memory.

Even 8 Mb may sound like a lot on all modern operating systems only pages that have something written to consume physical memory, the rest is cheap virtual memory.

Trait Implementations

impl Drop for EightMbStack[src]

fn drop(&mut self)[src]

Executes the destructor for this type. Read more

impl Stack for EightMbStack[src]

fn new() -> Result<Self, Error>[src]

Returns a new stack.

fn bottom(&self) -> *mut usize[src]

Returns a pointer to the bottom of the stack.

fn top(&self) -> *mut usize[src]

Returns a pointer to the top of the stack.

fn deallocation(&self) -> *mut usize[src]

Returns a pointer to the deallocation stack (a Windows construct).

impl Send for EightMbStack[src]

Auto Trait Implementations

Blanket Implementations

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

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

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

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

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

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

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

pub fn from(t: T) -> T[src]

Performs the conversion.

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

pub fn into(self) -> U[src]

Performs the conversion.

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.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

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.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.