[][src]Crate psm

Portable Stack Manipulation

This crate provides portable functions to control the stack pointer and inspect the properties of the stack. This crate does not attempt to provide safe abstractions to any operations, the only goals are correctness, portability and efficiency (in that exact order). As a consequence most functions you will find in this crate are unsafe.

Note, that the stack allocation is left up to the user. Unless you’re writing a safe abstraction over stack manipulation, this is unlikely to be the crate you want. Instead consider one of the safe abstractions over this crate such as stacker. Another good place to look at is the crates.io’s reverse dependency list.

Macros

psm_stack_information

Macro that outputs its tokens only if psm::stack_pointer and psm::StackDirection::new are available.

psm_stack_manipulation

Macro that outputs its tokens only if psm::on_stack and psm::replace_stack are available.

Enums

StackDirection

The direction into which stack grows as stack frames are made.

Functions

on_stack

Run the closure on the provided stack.

replace_stack

Run the provided non-terminating computation on an entirely new stack.

stack_pointer

Returns current stack pointer.