Open
Conversation
JohnMcPMS
reviewed
Feb 11, 2021
| ThrowErrorIfNot(Error::InflateRead,(self->m_compressionObject->GetAvailableSourceSize() == 0), "uninflated bytes overwritten"); | ||
| ULONG available = 0; | ||
| self->m_compressedBuffer = std::make_unique<std::vector<std::uint8_t>>(BufferSize); | ||
| self->m_compressedBuffer.swap(std::make_unique<std::vector<std::uint8_t>>(BufferSize)); |
Member
There was a problem hiding this comment.
It is unclear what value this change is providing, unless there are bugs in the STL/compiler being used.
|
|
||
| InflateStream::~InflateStream() | ||
| { | ||
| m_compressedBuffer = nullptr; |
Member
There was a problem hiding this comment.
It seems odd that there is memory pressure from having this allocated while Cleanup is running.
| struct unique_hash_handle_deleter { | ||
| void operator()(BCRYPT_HASH_HANDLE h) const { | ||
| BCryptDestroyHash(h); | ||
| #include <deque> |
Member
There was a problem hiding this comment.
I don't agree with the change here; either our usage of unique_ptr is flawed and should be fixed, or this is unnecessary. Adding this additional overhead isn't the right answer.
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 free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The two bug fixes made by Phil being backported into this repo by this PR are,
-fix memory leak external/msix-sdk/src/msix/PAL/Crypto/Win32/Crypto.cpp
-fix regression in inflatestream.cpp that results in unnecessary memory pressure.