- Fix possible cast error in
updateandputIfAbsent.MapBaseusescontainsKeywhich is unreliable and creates data race (due to GC) between check and read. - Optimize
length.MapBaseuseskeys.lengthwhich causes iteration and creation of strong snapshot.
- Optimize cache entry removal performance.
Previously
removeWherewas used which caused iteration of whole cache set on every removal. Now additionalExpandois used to map Weak references to their keys.
- Fix web release target compilation.
- Add
weak_cache.utilslibrary withexpandoCompatibleutility function. - Update type check, to correctly detect all disallowed values types.
- Remove dependency on
package:disposed. - Fix "leak" of nulled Weak references, if objects where added while iterating.
Generally you should not modify cache while iterating it, but this is technically possible.
- Requires Dart 3.0.0
- BREAKING: remove
WeakCache.cacheFinalizer. - Fix memory leak caused by instance member finalizer.
- Optimize
containsValue. - Fix concurrent modification error, now using keys/values/entries will temporarily prevent them from being garbage collected.
- Initial version.