-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FileStream rewrite: Caching the ValueTaskSource in AsyncWindowsFileSt…
…reamStrategy (#51363) * Caching the ValueTaskSource in AsyncWindowsFileStreamStrategy * Add debug assert to WriteByteSlow for _writePos == _bufferSize * Fix assertion failure * Apply suggestions from code review * Apply suggestions from code review * some pedantic polishing * fix the allocation bug: actually return the instance to the "pool" * don't Dipose the handle if it has default value * reset _result and _source in the Configure method * delay the moment when the ValueTaskSource becomes ready to be reused to the moment after _source.SetException|SetResult is called * apply Stephen suggestions * implement Stephen idea * use Reset in explicit way * remove outdated comment * address code review feedback Co-authored-by: carlossanlop <carlossanlop@users.noreply.github.com> Co-authored-by: David Cantú <dacantu@microsoft.com> Co-authored-by: Adam Sitnik <adam.sitnik@gmail.com>
- Loading branch information
1 parent
f26bc6a
commit 7878130
Showing
4 changed files
with
72 additions
and
100 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
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