Debian Codegraph @

Changes

raw
1 Revision history for Perl extension Cache::FastMmap.
2
3 1.62 Sun May 17 2026
4 - Fix remaining Perl-side lock leaks when user supplied
5 serializer/deserializer code throws while get_and_set()
6 or other locked paths are active.
7 - Validate get_and_set() callback options before merging
8 them into the internal locked set() call.
9 - Fix expire() in write-back mode to write back the
10 original Perl value, not the serialized/compressed bytes.
11 - Track all live empty_on_exit caches independently instead
12 of keeping only one weak reference per class.
13 - Preserve silent write/delete callback failure behavior while
14 keeping locks exception-safe for serializer/deserializer failures.
15 - Add regression coverage for expire() with serialized values,
16 multiple empty_on_exit caches, and locked exception paths.
17
18 1.61 Sat Apr 25 23:18 2026
19 - Remove Cache::FastMmap::OnLeave guard object and inline
20 fc_lock/fc_unlock at every call site. The per-call cost
21 of building and destroying the guard closure was a
22 meaningful share of CPU in cache-heavy workloads.
23 - Replace the internal skip_lock/skip_unlock guard-passing
24 pattern (used by get_and_set / get_and_remove) with a
25 simpler _locked => 1 boolean flag.
26 - Preserve the documented exception-safety contract for
27 get_and_set, plus the equivalent unwritten contract for
28 get (read_cb that dies), multi_get, and multi_set: the
29 page lock is always released even when user code throws.
30 - Add t/24.t covering the lock-release contract on every
31 exception path.
32 - mmc_write: check for available space before deleting an
33 existing slot for the key, so a failed set() preserves
34 the previous value instead of silently losing it.
35 - _mmc_set_error (unix.c, win32.c): use snprintf into the
36 remaining buffer space instead of strncat with the wrong
37 size argument, which could overflow errbuf on long error
38 messages.
39 - mmc_lock: fix off-by-one allowing page == c_num_pages
40 (one past the last valid page).
41 - mmc_lock: replace hardcoded num_slots >= 89 sanity check
42 with cache->start_slots, so caches built with custom
43 start_slots values lock correctly.
44 - mmc_check_fh: check fstat() return value before trusting
45 statbuf.st_ino, restoring the safety net the function
46 was added for.
47 - mmc_iterate_next: end iteration cleanly if mmc_lock fails
48 instead of walking stale page state.
49 - Win32 mmc_unlock_page: split p_offset into Offset and
50 OffsetHigh and add the missing return, so caches larger
51 than 4GB unlock at the same offset they locked at.
52 - Win32 mmc_lock_page: CloseHandle on the event handle on
53 every exit path; previously every successful lock leaked
54 one HANDLE.
55
56 1.60 Wed Jun 18 9:25 2025
57 - Fix very broken 1.59 release that was leaving pages
58 locked after initialising them.
59
60 1.59 Tue Jun 3 17:25 2025
61 - Add exists() method to check if key exists in the
62 cache. This avoid the decompress + deserialize cost
63 - Initialise pages under lock. This avoids potential
64 race conditions where multiple processes try and init
65 a cache file
66 - Correctly reset p_changed after storing changed details
67 back to cache.
68
69 1.58 Mon May 5 16:25 2025
70 - Catch a rare bug if someone closes our underlying file
71 handle unexpectedly
72
73 1.57 Thu Sep 30 16:25 2021
74 - Add expire($key) method to allow explicitly expiring
75 a key from the cache. In write-back mode, if the key
76 is dirty it will be written back, in other modes it's
77 the same as remove($key)
78
79 1.56 Mon Dec 14 14:35 2020
80 - Update MANIFEST to include all tests. It hasn't
81 been updated in a while
82
83 1.55 Mon Dec 14 12:10 2020
84 - Add ability to override internal value of 'time'
85 everywhere to make tests that check expiry of items
86 faster and more robust
87
88 1.54 Sat Dec 12 13:40 2020
89 - Add Test::Deep as dependency to Makefile.PL
90
91 1.53 Thu Dec 10 13:40 2020
92 - Handle expire_on being undef (use cache default) and
93 return undef if existing value not found in cache.
94 Makes get_and_set which passes on expire_on just work
95 in "doesn't exist" case
96
97 1.52 Thu Dec 10 12:20 2020
98 - Fix bug where a get() on a key that was expired would
99 cause that key to be deleted and never written back
100 even if it was dirty
101 - Added new expire_on naming so that expire_time
102 (relative future time) and expire_on (absolute
103 unix epoch time) are now clear and distinct
104 - Allow setting expire_on when doing a set() call,
105 which is useful from get_and_set() to maintain
106 an items absolute expiry time
107
108 1.51 Wed Nov 11 17:15 2020
109 - Skip JSON/Sereal tests if modules not present
110 - Updated .gitignore
111 Thanks to https://github.com/szabgab/
112 - GitHub Actions config file
113 Thanks to https://github.com/szabgab/
114
115 1.50 Fri Nov 6 20:40 2020
116 - Allow get_and_set sub to return an options
117 hash passed to the internal set call
118
119 1.49 Tue Mar 24 10:15 2020
120 - Fix windows compilation and test warnings
121 Thanks to [email protected]
122
123 1.48 Thu Apr 11 11:30 2019
124 - Remove use of // so we should work on 5.8 again
125 - Replace -1 with a NOPAGE constant
126 - Use 64bit offsets so we support caches > 4G
127 - Various valgrind code fixes
128 Thanks to [email protected]
129
130 1.47 Fri Apr 6 11:10 2018
131 - Allow custom serializer or compressor options
132 - Update bugtracker link to github
133 Thanks to [email protected]
134
135 1.46 Fri Jul 14 19:40 2017
136 - Fix tests on older perls (thanks [email protected])
137 - Use File::Spec for temp dir (thanks [email protected])
138 - Fix mmap_cache_internals.h include guard
139 - Fix get_and_set() always returning 0 for DidStore
140 - Allow setting permission when creating cache file
141 - Tweak leak detection tests
142 - Fix last_access/expire_time checks for impending
143 1500000000 seconds since epoch
144
145 1.45 Thu Mar 14 11:10 2017
146 - Deprecate raw_values and compress options, add
147 new compressor and serializer options to allow
148 different compressors and serializers.
149 Initial compressor support: zlib, lz4, snappy
150 Initial serializer support: storable, sereal, json
151 Thanks to [email protected] for initial work
152
153 1.44 Wed Jun 1 21:45 2016
154 - Set FD_CLOEXEC flag on cache files when opened.
155 Particularly useful in Net::Server where
156 HUPing a process causes it to exec() itself.
157 Unless you undef the cache references, you'll
158 leak fd's after each HUP
159
160 1.43 Fri Oct 23 14:00 2015
161 - Update copyright + version correctly everywhere
162
163 1.42 Fri Oct 23 13:30 2015
164 - Allow get_and_set callback to return an empty list
165 which means "no change". This allows atomic
166 "get, and set if not present" type action, but
167 without resetting the expiry time on each get.
168 This is basically the same as using the read_cb
169
170 1.41 Thu Aug 29 15:30 2013
171 - Actually reuse deleted slots. Meant that if
172 you used ->remove() a lot, we would re-organise
173 cache more than needed
174 - Include typo and meta patches from dsteinbrunner
175
176 1.40 Mon Dec 5 10:30 2011
177 - Work around reference holding bug in
178 Compress::Zlib
179
180 1.39 Mon Jul 18 09:50 2011
181 - Remove CImpl and simplify structure into just
182 Cache::FastMmap module making all XS calls
183 just function calls in Cache::FastMmap
184 namespace
185
186 1.38 Sun Jul 17 18:30 2011
187 - Fix build process that was completely broken
188 after moving files around into different
189 directories
190
191 1.37 Fri Jul 15 16:30 2011
192 - Use a lock object with DESTROY method to avoid
193 an alarm with a die leaving around a locked
194 paged
195
196 1.36 Wed Sep 29 13:10 2010
197 - Disable wrapping fcntl() lock call in alarm, hurts
198 people that use Time::HiRes::alarm() only to try
199 and catch buggy deadlock code. Enable with
200 catch_deadlocks option
201
202 1.35 Fri Feb 19 12:45 2010
203 - Fix for returning potential bug that returns old stored
204 data. Could occur if you mix deletes
205 (thanks Darrell Bishop)
206
207 1.34 Fri Jun 19 12:00 2009
208 - perldoc fix (thanks Jonathan Yu)
209
210 1.33 Thu Jun 18 12:00 2009
211 - Update version in META.yml
212
213 1.32 Thu Jun 18 11:55 2009
214 - Better LiveCaches tracking via DESTROY
215
216 1.31 Thu Jun 18 11:40 2009
217 - when in raw_values => 0 mode, the write_cb is now
218 correctly called with thawed data, rather than the
219 raw frozen data
220 - empty_on_exit correctly called even when a global
221 cache is left at interpreter exit time (required
222 Scalar::Util qw(weaken) for object tracking)
223
224 1.30 Fri May 8 11:10 2009
225 - Fix for Mandriva compiler (thanks Jean-Christian Hassler)
226
227 1.29 Fri May 1 17:20 2009
228 - Support for Windows (thanks to Ash & kmx.at.volny.cz)
229 (https://rt.cpan.org/Public/Bug/Display.html?id=45210)
230 (https://rt.cpan.org/Public/Bug/Display.html?id=16501)
231
232 1.28 Fri Jun 27 11:05 2008
233 - get_and_set() returns new value + didstore boolean
234 if called in list context
235
236 1.27 Wed Jun 18 17:15 2008
237 - Fix non-ansi C code
238 - Remove debug flags
239
240 1.26 Thu May 22 14:50 2008
241 - Check for write failure when creating file
242 thanks to Sam Vilain
243 - Check for $ENV{TMP_DIR}
244 thanks to Sam Vilain
245 - Add compress option
246 - Add basic statistics gathering
247
248 1.25 Mon Feb 04 13:20 2008
249 - Fix multi_set bug and add test
250 (http://rt.cpan.org/Ticket/Display.html?id=32895)
251 - Test share_file is not a reference
252 (http://rt.cpan.org/Ticket/Display.html?id=32252)
253 - Fix C variable declaration error
254 (http://rt.cpan.org/Ticket/Display.html?id=31223)
255 - Fix compile warnings in FreeBSD
256 (http://rt.cpan.org/Ticket/Display.html?id=31900)
257 - Thanks to all the people that contributed
258 to the above bugs
259
260 1.24 Mon Oct 22 13:15 2007
261 - Add atomic get_and_remove() method thanks to
262 Darrell Bishop
263
264 1.23 Wed Oct 17 16:00 2007
265 - Fix expire time parsing
266
267 1.22 Wed Oct 17 14:05 2007
268 - If third parameter to set() is not a references, treat it as
269 a specify expiry time. Increases compatiability with
270 Cache::Cache API. Helpful for Catalyst framework
271
272 1.21 Tue Oct 16 10:40 2007
273 - if first parameter to new() is a hash ref, use it as
274 the options hash. Helpful for Catalyst framework
275
276 1.20 Thu Oct 2 13:40 2007
277 - add to documentation about page size and cache file locations
278 - fix t/6.t test failure under new Test::More
279
280 1.19 Thu Aug 23 09:03 2007
281 - bad C declaration crept in again, now in svn
282
283 1.18 Thu Aug 22 17:30 2007
284 - fix use of $^O not to catch "darwin"
285 (http://rt.cpan.org/Ticket/Display.html?id=28330)
286
287 1.17 Thu Aug 22 17:14 2007
288 - fix declaration in C code that wasn't legal C
289
290 1.16 Thu May 8 17:12 2007
291 - fix typo in Changes file (1.15 is 2007, not 2006)
292 - fix get_keys(2) when undef values in cache
293 - fix some leak detection tests
294
295 1.15 Thu May 8 17:12 2007
296 - catch and rethrow die/exceptions in get_and_set() callbacks
297 - avoid undef warnings when using cache_not_found mode
298 - use unique tempfile name rather than the same every time
299 - add allow_recursive option to allow calls to cache
300 from within a read/write callback sub
301 - add checks to die if we try and lock a cache twice,
302 rather than just causing mysterious errors
303 - add unlink_on_exit to automatically delete the share_file
304 when the cache exits. default to true if we created
305 the share_file, false if we connected to an existing one
306 - make empty_on_exit only call empty if the pid of the
307 process we're cleaning up in is the same as the pid we
308 were created in
309 - die in CLONE, making it clear threads aren't supported
310
311 1.14 Thu Oct 20 11:45 2006
312 - alter calc_expunge to allow more efficient alternate
313 implementation cases
314
315 1.13 Thu Oct 20 11:15 2006
316 - mention UNIX/Win32 compatiability in docs
317 (http://rt.cpan.org/Ticket/Display.html?id=16501)
318 - detect page corruption better and croak rather than segfault
319 (http://rt.cpan.org/Ticket/Display.html?id=17335)
320 - when running in raw_values => 0 mode, always store
321 reference to data. Storable doesn't like freeze(SCALAR)
322 (http://rt.cpan.org/Ticket/Display.html?id=16762)
323 - Handle edge case of slot count increase when page
324 already nearly full possibly causing corruption
325 (can only happen if ->purge() called at just the wrong time)
326
327 1.12 Thu Oct 19 09:50 2006
328 - allow writing into a deleted slot
329
330 1.11 Web Oct 18 15:10 2006
331 - allow setting default slot count via start_slots argument
332
333 1.10 Web Oct 18 14:50 2006
334 - fc_lock() would segfault if no slots were available.
335 Doesn't happen in normal usage, but can happen if
336 cache behaviour altered by alternate code
337
338 1.09 Thu Feb 7 15:50 2005
339 - add get_and_set() routine to allow atomic reading and
340 writing of a cache value (thanks to Sreeji Das)
341 - fix some tests
342
343 1.08 Thu Aug 26 12:18 2004
344 - really remove dependency on perl 5.8
345
346 1.07 Thu Aug 19 22:18 2004
347 - add extra documentation
348 - add parameter to empty() method
349 - add ability to test integrity of cache file
350 - remove dependency on perl 5.8
351
352 1.06 Thu May 10 17:18 2004
353 - add multi_set and multi_get methods
354
355 1.05 Sat Jan 31 17:24 2004
356 - fix another edge case where page would get full, but never
357 expunged when storing references
358
359 1.04 Sun Jan 25 00:46 2004
360 - fix test file after new changes
361
362 1.03 Sun Jan 25 00:21 2004
363 - fix bad sorting when removing old cache entries
364
365 1.02 Sat Jan 24 17:05 2004
366 - fix edge case where page would get full, but never expunged
367
368 1.01 Sat Dec 13 18:17 2003
369 - fix leak from improper munmap call
370
371 1.00 Sat Dec 13 14:19 2003
372 - initial release