Skip to content

Release v6.2.4

Choose a tag to compare

@awolverp awolverp released this 09 Aug 16:13
· 50 commits to main since this release

This is a patch release that fixes two important correctness and stability issues.

Bug Fixes

  • #67 / #68: setdefault_with no 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(), and items() 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

Full Changelog: v6.2.3...v6.2.4