-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Copy the
FnOnce
instance to the new stack.
This commit includes many changes, because I noticed that keeping a reference to the `FnOnce` instance in the old stack, and copying it from the trampoline is not safe: even if the `Coro::new` function does not drop `f`, its caller is free to clobber the stack containing `f` prior to activating the coroutine. The fix required a major change to the control structure, and it now includes a new mechanism to detect situations when `yield` is called from outside a coroutine. The good news is that the `simple` test now passes! This commit also adds a control transfer mechanism optimized for the last return of a coroutine.
- Loading branch information
Showing
3 changed files
with
297 additions
and
121 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.