Uh oh!
There was an error while loading. Please reload this page.
Memorify DeflateManagedStream - #47389
Closed
NewellClark wants to merge 5 commits into
Closed
Conversation
ghost
commented
Jan 24, 2021
I couldn't figure out the best area label to add to this PR. If you have write-permissions please help me learn by adding exactly one area label. |
NewellClark
commented
Jan 24, 2021
ContributorAuthor
Area label should be |
…y-DeflateManagedStream
NewellClark
marked this pull request as draft
January 25, 2021 08:46
Uh oh!
There was an error while loading. Please reload this page.
| { | ||
| Debug.Assert(_formatReader != null); | ||
| _formatReader.UpdateWithBytesRead(bytes, offset, copied); | ||
| // Skip the copy if bytes is actually an array. |
Member
There was a problem hiding this comment.
This is all dead code. _formatReader is always going to be null.
ContributorAuthor
There was a problem hiding this comment.
That's awesome! I think what I'm going to do is wait until #47408 is merged, and then I'll redo this pull-request. That way we'll avoid merge conflicts.
NewellClark
commented
Jan 25, 2021
ContributorAuthor
I'm closing this for now. I'll redo it once 47408 has merged to avoid merge conflicts, and because my implementation broke CI. |
This file contains hidden or 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
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is one of the violations found by this prototype analyzer.
Unfortunately, one path of execution calls into IFileFormatReader, which does not support Span and Memory. I did the same thing that I did with my CryptoStream PR and check if the memory is an array, and simply do the copy if it is.
Unlike with
CryptoStream, however,IFileFormatReaderis an internal interface, so we may be able to change it down the road. Might be something worth considering. I can create an issue for that if it's deemed worthwhile.