Skip to content

Commit 8ad9cf8

Browse files
committed
rt: Add more stack-switching commentary
1 parent 5d2442d commit 8ad9cf8

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/rt/rust_task.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -732,6 +732,11 @@ rust_task::config_notify(chan_handle chan) {
732732
notify_chan = chan;
733733
}
734734

735+
// This is the function that switches stacks by calling another function with
736+
// a single void* argument while changing the stack pointer. It has a funny
737+
// name because gdb doesn't normally like to backtrace through split stacks
738+
// (thinks it indicates a bug), but has a special case to allow functions
739+
// named __morestack to move the stack pointer around.
735740
extern "C" void __morestack(void *args, void *fn_ptr, uintptr_t stack_ptr);
736741

737742
static uintptr_t

0 commit comments

Comments
 (0)