Trait switcheroo::stack::Stack[][src]

pub trait Stack: Sized + Send {
    fn new() -> Result<Self, Error>;
fn bottom(&self) -> *mut usize;
fn top(&self) -> *mut usize;
fn deallocation(&self) -> *mut usize; }

An implementation of this trait will be accepted by a generator as a valid Stack. Most of the functions provided here are straightforward except for deallocation, this is a Windows only construct.

Windows reserves a few pages above the stack top, so if a stack overflow exception is triggered the handler has still enough of stack to process it. The name comes from the fact that it points to the top most address of the memory area designated to the stack and will be used as a pointer when freeing/deallocating the stack.

Required methods

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).

Loading content...

Implementors

Loading content...