Skip to content

Commit b9e0ee8

Browse files
committed
rt: Add docs to stack functions
1 parent 3af4b2c commit b9e0ee8

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/rt/rust_stack.h

+6
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,15 @@ const uint8_t stack_canary[] = {0xAB, 0xCD, 0xAB, 0xCD,
1919
0xAB, 0xCD, 0xAB, 0xCD,
2020
0xAB, 0xCD, 0xAB, 0xCD};
2121

22+
// Used by create_stack
2223
void
2324
register_valgrind_stack(stk_seg *stk);
2425

26+
// Used by destroy_stack
2527
void
2628
deregister_valgrind_stack(stk_seg *stk);
2729

30+
// Used by create_stack
2831
void
2932
add_stack_canary(stk_seg *stk);
3033

@@ -47,9 +50,12 @@ destroy_stack(T allocer, stk_seg *stk) {
4750
allocer->free(stk);
4851
}
4952

53+
// Must be called before each time a stack is reused to tell valgrind
54+
// that the stack is accessible.
5055
void
5156
prepare_valgrind_stack(stk_seg *stk);
5257

58+
// Run a sanity check
5359
void
5460
check_stack_canary(stk_seg *stk);
5561

0 commit comments

Comments
 (0)