-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Free resources in a try/finally #72961
Conversation
@@ -205,57 +205,62 @@ static void AddAll(HashSet<Checksum> checksums, ChecksumCollection checksumColle | |||
var usePool = missingChecksumsCount <= PooledChecksumArraySize; | |||
var missingChecksums = usePool ? s_checksumPool.Allocate() : new Checksum[missingChecksumsCount]; | |||
|
|||
missingChecksumsCount = 0; | |||
foreach (var checksum in checksums) | |||
try |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
view with whitespace off.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💭 Seems like the pool could just be removed in favor of stackalloc
for the initial array.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, nevermind due to callbacks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and async/await :(
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No description provided.