Skip to main content

stack_register

Function stack_register 

Source
pub fn stack_register(start: usize, end: usize) -> StackId
Expand description

Mark a piece of memory as being a stack. Returns a super::StackId

start is the lowest addressable stack byte, end is the highest addressable stack byte.

Registers a new stack. Informs Valgrind that the memory range between start and end is a unique stack. Returns a stack identifier that can be used with the other stack_change and stack_deregister client requests. Valgrind will use this information to determine if a change to the stack pointer is an item pushed onto the stack or a change over to a new stack. Use this if you’re using a user-level thread package and are noticing crashes in stack trace recording or spurious errors from Valgrind about uninitialized memory reads.

Warning: Unfortunately, this client request is unreliable and best avoided.