Replace static ImagingCache with instanced WeakReferenceCache<K, V>#10543
Open
h3xds1nz wants to merge 7 commits intodotnet:mainfrom
Open
Replace static ImagingCache with instanced WeakReferenceCache<K, V>#10543h3xds1nz wants to merge 7 commits intodotnet:mainfrom
h3xds1nz wants to merge 7 commits intodotnet:mainfrom
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #10543 +/- ##
===================================================
+ Coverage 10.99508% 11.41030% +0.41521%
===================================================
Files 3215 3214 -1
Lines 648472 648414 -58
Branches 71534 71507 -27
===================================================
+ Hits 71300 73986 +2686
+ Misses 576170 573266 -2904
- Partials 1002 1162 +160
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
...Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/Imaging/WeakReferenceCache.cs
Outdated
Show resolved
Hide resolved
...Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/Imaging/WeakReferenceCache.cs
Outdated
Show resolved
Hide resolved
...Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/Imaging/WeakReferenceCache.cs
Outdated
Show resolved
Hide resolved
...Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/Imaging/WeakReferenceCache.cs
Outdated
Show resolved
Hide resolved
...Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/Imaging/WeakReferenceCache.cs
Show resolved
Hide resolved
...Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/Imaging/WeakReferenceCache.cs
Outdated
Show resolved
Hide resolved
Member
Author
|
@ThomasGoulet73 I've made a few more changes, if you get a minute, please review. |
lindexi
reviewed
Mar 11, 2025
src/Microsoft.DotNet.Wpf/src/PresentationCore/MS/internal/WeakReferenceCache.cs
Show resolved
Hide resolved
lindexi
reviewed
Mar 11, 2025
src/Microsoft.DotNet.Wpf/src/PresentationCore/MS/internal/WeakReferenceCache.cs
Outdated
Show resolved
Hide resolved
Contributor
LGTM now, thanks. |
|
Your We wanted something similar in winforms, I am not sure it ever got done. Maybe chime in on the issue to see if we can get more traction to implement in runtime? |
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.
Description
Replaces static
ImagingCacheused withinBitmapDecoderandBitmapImagewith a more OOP-friendly solution ofWeakReferenceCache<K, V>, using strongly-typed generic version for WeakRefs and usingLockinstead of locking on instance.This behaves the same way as the previous one. And another
ArrayListdefinition gone.Customer Impact
Cleaner codebase for developers mostly, improved performance/allocs during cleanups.
Regression
No.
Testing
Local build.
Risk
Should be low but review carefully.
Microsoft Reviewers: Open in CodeFlow