Expand description
§cortex-m-stack
Methods for Cortex-M processors to determine stack size and how much of the stack has been or is being used.
Warning: this crate depends on the _stack_start and _stack_end symbols being set correctly.
The cortex-m crates achieve this with their linker scripts, but the flip-link linker does not until PR #126 has landed.
§Immediate stack usage
Use current_stack_in_use or current_stack_free to keep track of the memory usage at run-time.
§Historical stack usage
First paint the stack using repaint_stack and then measure using stack_painted or stack_painted_binary to figure out how much stack was used between these two points.
Constants§
- STACK_
PAINT_ VALUE - The value used to paint the stack.
Functions§
- current_
stack_ fraction - What fraction of the stack is currently in use.
- current_
stack_ free - The number of bytes of the stack that are currently free.
- current_
stack_ in_ use - The number of bytes of the stack that are currently in use.
- current_
stack_ ptr - Convenience function to fetch the current stack pointer.
- repaint_
stack - Paint the part of the stack that is currently not in use.
- stack
- The Range currently in use for the stack.
- stack_
painted - Finds the number of bytes that have not been overwritten on the stack since the last repaint.
- stack_
painted_ ⚠binary - Finds the number of bytes that have not been overwritten on the stack since the last repaint using binary search.
- stack_
rev - The Range currently in use for the stack, defined in reverse such that Range operations are viable.
- stack_
size - The number of bytes that are reserved for the stack at compile time.