Release v6.2.4
This is a patch release that fixes two important correctness and stability issues.
Bug Fixes
-
#67 / #68:
setdefault_withno longer runs the factory while holding the internal lock.
Previously, if the factory triggered a GC pass (which also needs the same lock), the whole process could freeze. The key is now looked up under the lock, the lock is released, the factory runs, and the lock is re-acquired only to insert (with a re-check).
Note: If two threads miss the same key at the same time, the factory may run twice; the first inserted value is kept and returned to both callers. -
#69 / #70: Iterators returned by
keys(),values(), anditems()now hold a strong reference to the cache.
Previously they only kept a raw cursor, so a cache that was no longer referenced elsewhere could be freed while the iterator was still alive, causing use-after-free (access violation or silently wrong results). This is fixed for all seven cache types with no performance regression.
Special Thanks To
- @Malkiz223 for finding and fixing both issues in #68 and #70.
Full Changelog: v6.2.3...v6.2.4