Cache-FastMmap
view release on metacpan or search on metacpan
Revision history for Perl extension Cache::FastMmap.
1.62 Sun May 17 2026
- Fix remaining Perl-side lock leaks when user supplied
serializer/deserializer code throws while get_and_set()
or other locked paths are active.
- Validate get_and_set() callback options before merging
them into the internal locked set() call.
- Fix expire() in write-back mode to write back the
original Perl value, not the serialized/compressed bytes.
- Track all live empty_on_exit caches independently instead
of keeping only one weak reference per class.
- Preserve silent write/delete callback failure behavior while
keeping locks exception-safe for serializer/deserializer failures.
- Add regression coverage for expire() with serialized values,
multiple empty_on_exit caches, and locked exception paths.
1.61 Sat Apr 25 23:18 2026
- Remove Cache::FastMmap::OnLeave guard object and inline
fc_lock/fc_unlock at every call site. The per-call cost
of building and destroying the guard closure was a
meaningful share of CPU in cache-heavy workloads.
- Replace the internal skip_lock/skip_unlock guard-passing
pattern (used by get_and_set / get_and_remove) with a
simpler _locked => 1 boolean flag.
- Preserve the documented exception-safety contract for
get_and_set, plus the equivalent unwritten contract for
get (read_cb that dies), multi_get, and multi_set: the
page lock is always released even when user code throws.
- Add t/24.t covering the lock-release contract on every
exception path.
- mmc_write: check for available space before deleting an
existing slot for the key, so a failed set() preserves
the previous value instead of silently losing it.
- _mmc_set_error (unix.c, win32.c): use snprintf into the
remaining buffer space instead of strncat with the wrong
size argument, which could overflow errbuf on long error
messages.
- mmc_lock: fix off-by-one allowing page == c_num_pages
(one past the last valid page).
- mmc_lock: replace hardcoded num_slots >= 89 sanity check
with cache->start_slots, so caches built with custom
start_slots values lock correctly.
- mmc_check_fh: check fstat() return value before trusting
statbuf.st_ino, restoring the safety net the function
was added for.
- mmc_iterate_next: end iteration cleanly if mmc_lock fails
instead of walking stale page state.
- Win32 mmc_unlock_page: split p_offset into Offset and
OffsetHigh and add the missing return, so caches larger
than 4GB unlock at the same offset they locked at.
- Win32 mmc_lock_page: CloseHandle on the event handle on
every exit path; previously every successful lock leaked
one HANDLE.
1.60 Wed Jun 18 9:25 2025
- Fix very broken 1.59 release that was leaving pages
locked after initialising them.
1.59 Tue Jun 3 17:25 2025
- Add exists() method to check if key exists in the
cache. This avoid the decompress + deserialize cost
- Initialise pages under lock. This avoids potential
race conditions where multiple processes try and init
a cache file
- Correctly reset p_changed after storing changed details
back to cache.
1.58 Mon May 5 16:25 2025
- Catch a rare bug if someone closes our underlying file
handle unexpectedly
1.57 Thu Sep 30 16:25 2021
- Add expire($key) method to allow explicitly expiring
a key from the cache. In write-back mode, if the key
is dirty it will be written back, in other modes it's
the same as remove($key)
1.56 Mon Dec 14 14:35 2020
- Update MANIFEST to include all tests. It hasn't
been updated in a while
1.55 Mon Dec 14 12:10 2020
- Add ability to override internal value of 'time'
everywhere to make tests that check expiry of items
faster and more robust
1.54 Sat Dec 12 13:40 2020
- Add Test::Deep as dependency to Makefile.PL
1.53 Thu Dec 10 13:40 2020
- Handle expire_on being undef (use cache default) and
return undef if existing value not found in cache.
Makes get_and_set which passes on expire_on just work
in "doesn't exist" case
1.52 Thu Dec 10 12:20 2020
- Fix bug where a get() on a key that was expired would
cause that key to be deleted and never written back
even if it was dirty
- Added new expire_on naming so that expire_time
(relative future time) and expire_on (absolute
unix epoch time) are now clear and distinct
- Allow setting expire_on when doing a set() call,
( run in 0.627 second using v1.01-cache-2.11-cpan-5b529ec07f3 )