-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove another reference field from async state machines
The async state machine Task-derived type currently adds three fields: - The StateMachine - An Action field for caching any delegate created to MoveNext - The ExecutionContext to flow to the next MoveNext invocation The other pending PR gets rid of the Action field by using the unused Action field from the base Task for that purpose. This PR gets rid of the ExecutionContext field by using the unused state object field from the base Task for that purpose. The field is exposed via the public AsyncState property, so this also uses a bit from the state flags field to prevent this state object from being returned from that property. The combination of removing those two fields shaves 16 bytes off of every `async Task` state machine box on 64-bit. The only remaining field added by the state machine type is for the state machine itself, which is required.
- Loading branch information
1 parent
1448de8
commit 7474e69
Showing
3 changed files
with
47 additions
and
7 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
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
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