r20324 - in /trunk/libcache-fastmmap-perl: ./ Cache-FastMmap-CImpl/ debian/ t/

eloy at users.alioth.debian.org eloy at users.alioth.debian.org
Fri May 23 08:37:21 UTC 2008


Author: eloy
Date: Fri May 23 08:37:20 2008
New Revision: 20324

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=20324
Log:
new upstream version

Added:
    trunk/libcache-fastmmap-perl/t/13.t
      - copied unchanged from r20323, branches/upstream/libcache-fastmmap-perl/current/t/13.t
    trunk/libcache-fastmmap-perl/t/14.t
      - copied unchanged from r20323, branches/upstream/libcache-fastmmap-perl/current/t/14.t
Modified:
    trunk/libcache-fastmmap-perl/Cache-FastMmap-CImpl/CImpl.pm
    trunk/libcache-fastmmap-perl/Cache-FastMmap-CImpl/CImpl.xs
    trunk/libcache-fastmmap-perl/Cache-FastMmap-CImpl/mmap_cache.c
    trunk/libcache-fastmmap-perl/Cache-FastMmap-CImpl/mmap_cache.h
    trunk/libcache-fastmmap-perl/Changes
    trunk/libcache-fastmmap-perl/FastMmap.pm
    trunk/libcache-fastmmap-perl/MANIFEST
    trunk/libcache-fastmmap-perl/META.yml
    trunk/libcache-fastmmap-perl/Makefile.PL
    trunk/libcache-fastmmap-perl/README
    trunk/libcache-fastmmap-perl/debian/changelog

Modified: trunk/libcache-fastmmap-perl/Cache-FastMmap-CImpl/CImpl.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcache-fastmmap-perl/Cache-FastMmap-CImpl/CImpl.pm?rev=20324&op=diff
==============================================================================
--- trunk/libcache-fastmmap-perl/Cache-FastMmap-CImpl/CImpl.pm (original)
+++ trunk/libcache-fastmmap-perl/Cache-FastMmap-CImpl/CImpl.pm Fri May 23 08:37:20 2008
@@ -15,7 +15,7 @@
 use strict;
 use warnings;
 
-our $VERSION = '1.25';
+our $VERSION = '1.26';
 
 require XSLoader;
 XSLoader::load('Cache::FastMmap::CImpl', $VERSION);

Modified: trunk/libcache-fastmmap-perl/Cache-FastMmap-CImpl/CImpl.xs
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcache-fastmmap-perl/Cache-FastMmap-CImpl/CImpl.xs?rev=20324&op=diff
==============================================================================
--- trunk/libcache-fastmmap-perl/Cache-FastMmap-CImpl/CImpl.xs (original)
+++ trunk/libcache-fastmmap-perl/Cache-FastMmap-CImpl/CImpl.xs Fri May 23 08:37:20 2008
@@ -381,6 +381,64 @@
 
     XPUSHs(sv_2mortal(newSViv((IV)did_delete)));
     XPUSHs(sv_2mortal(newSViv((IV)out_flags)));
+
+
+void
+fc_get_page_details(obj)
+    SV * obj;
+  INIT:
+    mmap_cache * cache;
+    MU32 nreads = 0, nreadhits = 0;
+
+    if (!SvROK(obj)) {
+      croak("Object not reference");
+      XSRETURN_UNDEF;
+    }
+    obj = SvRV(obj);
+    if (!SvIOKp(obj)) {
+      croak("Object not initiliased correctly");
+      XSRETURN_UNDEF;
+    }
+    cache = INT2PTR(mmap_cache *, SvIV(obj));
+    if (!cache) {
+      croak("Object not created correctly");
+      XSRETURN_UNDEF;
+    }
+
+
+  PPCODE:
+    mmc_get_page_details(cache, &nreads, &nreadhits);
+
+    XPUSHs(sv_2mortal(newSViv((IV)nreads)));
+    XPUSHs(sv_2mortal(newSViv((IV)nreadhits)));
+
+
+NO_OUTPUT void
+fc_reset_page_details(obj)
+    SV * obj;
+  INIT:
+    mmap_cache * cache;
+    MU32 nreads = 0, nreadhits = 0;
+
+    if (!SvROK(obj)) {
+      croak("Object not reference");
+      XSRETURN_UNDEF;
+    }
+    obj = SvRV(obj);
+    if (!SvIOKp(obj)) {
+      croak("Object not initiliased correctly");
+      XSRETURN_UNDEF;
+    }
+    cache = INT2PTR(mmap_cache *, SvIV(obj));
+    if (!cache) {
+      croak("Object not created correctly");
+      XSRETURN_UNDEF;
+    }
+
+
+  CODE:
+    mmc_reset_page_details(cache);
+
 
 
 void
@@ -660,3 +718,28 @@
     mmc_unlock(cache);
 
 
+NO_OUTPUT void
+fc_dump_page(obj);
+    SV * obj;
+  INIT:
+    mmap_cache * cache;
+
+    if (!SvROK(obj)) {
+      croak("Object not reference");
+      XSRETURN_UNDEF;
+    }
+    obj = SvRV(obj);
+    if (!SvIOKp(obj)) {
+      croak("Object not initiliased correctly");
+      XSRETURN_UNDEF;
+    }
+    cache = INT2PTR(mmap_cache *, SvIV(obj));
+    if (!cache) {
+      croak("Object not created correctly");
+      XSRETURN_UNDEF;
+    }
+
+  CODE:
+    _mmc_dump_page(cache);
+
+

Modified: trunk/libcache-fastmmap-perl/Cache-FastMmap-CImpl/mmap_cache.c
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcache-fastmmap-perl/Cache-FastMmap-CImpl/mmap_cache.c?rev=20324&op=diff
==============================================================================
--- trunk/libcache-fastmmap-perl/Cache-FastMmap-CImpl/mmap_cache.c (original)
+++ trunk/libcache-fastmmap-perl/Cache-FastMmap-CImpl/mmap_cache.c Fri May 23 08:37:20 2008
@@ -47,6 +47,8 @@
   MU32    p_old_slots;
   MU32    p_free_data;
   MU32    p_free_bytes;
+  MU32    p_n_reads;
+  MU32    p_n_read_hits;
 
   int    p_changed;
 
@@ -61,6 +63,7 @@
   /* Cache general details */
   MU32    start_slots;
   MU32    expire_time;
+  int     enable_stats;
 
   /* Share mmap file details */
   int    fh;
@@ -81,19 +84,6 @@
   MU32 *       slot_ptr_end;
 };
 
-
-/* Internal functions */
-int _mmc_set_error(mmap_cache *, int, char *, ...);
-void _mmc_init_page(mmap_cache *, MU32);
-
-MU32 * _mmc_find_slot(mmap_cache * , MU32 , void *, int, int );
-void _mmc_delete_slot(mmap_cache * , MU32 *);
-
-int _mmc_check_expunge(mmap_cache * , int);
-
-int  _mmc_test_page(mmap_cache *);
-int  _mmc_dump_page(mmap_cache *);
-
 /* Macros to access page entries */
 #define PP(p) ((MU32 *)p)
 
@@ -103,6 +93,8 @@
 #define P_OldSlots(p) (*(PP(p)+3))
 #define P_FreeData(p) (*(PP(p)+4))
 #define P_FreeBytes(p) (*(PP(p)+5))
+#define P_NReads(p) (*(PP(p)+6))
+#define P_NReadHits(p) (*(PP(p)+7))
 
 #define P_HEADERSIZE 32
 
@@ -165,6 +157,8 @@
   cache->share_file = def_share_file;
   cache->init_file = def_init_file;
   cache->test_file = def_test_file;
+
+  cache->enable_stats = 0;
 
   cache->last_error = 0;
 
@@ -186,6 +180,8 @@
     cache->share_file = val;
   } else if (!strcmp(param, "start_slots")) {
     cache->start_slots = atoi(val);
+  } else if (!strcmp(param, "enable_stats")) {
+    cache->enable_stats = atoi(val);
   } else {
     _mmc_set_error(cache, 0, "Bad set_param parameter: %s", param);
     return -1;
@@ -270,7 +266,15 @@
 
     memset(tmp, 0, cache->c_page_size);
     for (i = 0; i < cache->c_num_pages; i++) {
-      write(res, tmp, cache->c_page_size);
+      int written = write(res, tmp, cache->c_page_size);
+      if (written < 0) {
+    _mmc_set_error(cache, errno, "Write to share file %s failed", cache->share_file);
+ return -1;
+      }
+      if (written < cache->c_page_size) {
+    _mmc_set_error(cache, errno, "Write to share file %s failed; short write (%d of %d bytes written)", cache->share_file, written, cache->c_page_size);
+ return -1;
+      }
     }
     free(tmp);
 
@@ -468,6 +472,8 @@
   cache->p_old_slots = P_OldSlots(p_ptr);
   cache->p_free_data = P_FreeData(p_ptr);
   cache->p_free_bytes = P_FreeBytes(p_ptr);
+  cache->p_n_reads = P_NReads(p_ptr);
+  cache->p_n_read_hits = P_NReadHits(p_ptr);
 
   /* Reality check */
   if (cache->p_num_slots < 89 || cache->p_num_slots > cache->c_page_size)
@@ -520,6 +526,8 @@
     P_OldSlots(p_ptr) = cache->p_old_slots;
     P_FreeData(p_ptr) = cache->p_free_data;
     P_FreeBytes(p_ptr) = cache->p_free_bytes;
+    P_NReads(p_ptr) = cache->p_n_reads;
+    P_NReadHits(p_ptr) = cache->p_n_read_hits;
   }
 
   /* Test before unlocking */
@@ -588,6 +596,13 @@
   void **val_ptr, int *val_len,
   MU32 *flags
 ) {
+
+  /* Increase read count for page */
+  if (cache->enable_stats) {
+    cache->p_changed = 1;
+    cache->p_n_reads++;
+  }
+
   /* Search slots for key */
   MU32 * slot_ptr = _mmc_find_slot(cache, hash_slot, key_ptr, key_len, 0);
 
@@ -625,6 +640,10 @@
     *flags = S_Flags(base_det);
     *val_len = S_ValLen(base_det);
     *val_ptr = S_ValPtr(base_det);
+
+    /* Increase read hit count */
+    if (cache->enable_stats)
+      cache->p_n_read_hits++;
 
     return 0;
   }
@@ -994,6 +1013,32 @@
 }
 
 /*
+ * void mmc_get_page_details(mmap_cache * cache, MU32 * n_reads, MU32 * n_read_hits)
+ *
+ * Return details about the current locked page. Currently just
+ * number of reads and number of reads that hit
+ *
+*/
+void mmc_get_page_details(mmap_cache * cache, MU32 * n_reads, MU32 * n_read_hits) {
+  *n_reads = cache->p_n_reads;
+  *n_read_hits = cache->p_n_read_hits;
+  return;
+}
+
+/*
+ * void mmc_reset_page_details(mmap_cache * cache)
+ *
+ * Reset any page details (currently just read hits)
+ *
+*/
+void mmc_reset_page_details(mmap_cache * cache) {
+  cache->p_n_reads = 0;
+  cache->p_n_read_hits = 0;
+  cache->p_changed = 1;
+  return;
+}
+
+/*
  * mmap_cache_it * mmc_iterate_new(mmap_cache * cache)
  *
  * Setup a new iterator to iterate over stored items
@@ -1242,6 +1287,8 @@
     P_OldSlots(p_ptr) = 0;
     P_FreeData(p_ptr) = P_HEADERSIZE + cache->start_slots * 4;
     P_FreeBytes(p_ptr) = cache->c_page_size - P_FreeData(p_ptr);
+    P_NReads(p_ptr) = 0;
+    P_NReadHits(p_ptr) = 0;
   }
 }
 
@@ -1319,10 +1366,10 @@
       MU32 kvlen = S_SlotLen(base_det);
       ROUNDLEN(kvlen);
 
-      ASSERT(last_access > 1000000000 && last_access < 1200000000);
-      if (!(last_access > 1000000000 && last_access < 1200000000)) return 0;
-      ASSERT(expire_time == 0 || (expire_time > 1000000000 && expire_time < 1200000000));
-      if (!(expire_time == 0 || (expire_time > 1000000000 && expire_time < 1200000000))) return 0;
+      ASSERT(last_access > 1000000000 && last_access < 1500000000);
+      if (!(last_access > 1000000000 && last_access < 1500000000)) return 0;
+      ASSERT(expire_time == 0 || (expire_time > 1000000000 && expire_time < 1500000000));
+      if (!(expire_time == 0 || (expire_time > 1000000000 && expire_time < 1500000000))) return 0;
 
       ASSERT(key_len >= 0 && key_len < data_size);
       if (!(key_len >= 0 && key_len < data_size)) return 0;
@@ -1405,9 +1452,9 @@
         S_SlotHash(base_det), S_Flags(base_det));
 
       /* Get data */
-      memcpy(S_KeyPtr(base_det), key, key_len > 256 ? 256 : key_len);
+      memcpy(key, S_KeyPtr(base_det), key_len > 256 ? 256 : key_len);
       key[key_len] = 0;
-      memcpy(S_ValPtr(base_det), val, val_len > 256 ? 256 : val_len);
+      memcpy(val, S_ValPtr(base_det), val_len > 256 ? 256 : val_len);
       val[val_len] = 0;
 
       printf("  K=%s, V=%s\n", key, val);

Modified: trunk/libcache-fastmmap-perl/Cache-FastMmap-CImpl/mmap_cache.h
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcache-fastmmap-perl/Cache-FastMmap-CImpl/mmap_cache.h?rev=20324&op=diff
==============================================================================
--- trunk/libcache-fastmmap-perl/Cache-FastMmap-CImpl/mmap_cache.h (original)
+++ trunk/libcache-fastmmap-perl/Cache-FastMmap-CImpl/mmap_cache.h Fri May 23 08:37:20 2008
@@ -103,7 +103,10 @@
  * 
  * - FreeBytes (4 bytes) - Bytes left in free data area
  * 
- * - Reserved (8 bytes)
+ * - N Reads (4 bytes) - Number of reads performed on this page
+ *
+ * - N Read Hits (4 bytes) - Number of reads on this page that have hit
+ *   something in the cache
  * 
  * - Slots (4 bytes * NumSlots) - Hash slots
  *
@@ -205,7 +208,21 @@
 MU32 * mmc_iterate_next(mmap_cache_it *);
 void mmc_iterate_close(mmap_cache_it *);
 
-/* Retrieve details of a cache entry */
+/* Retrieve details of a cache page/entry */
 void mmc_get_details(mmap_cache *, MU32 *, void **, int *, void **, int *, MU32 *, MU32 *, MU32 *);
-
-
+void mmc_get_page_details(mmap_cache * cache, MU32 * nreads, MU32 * nreadhits);
+void mmc_reset_page_details(mmap_cache * cache);
+
+/* Internal functions */
+int _mmc_set_error(mmap_cache *, int, char *, ...);
+void _mmc_init_page(mmap_cache *, MU32);
+
+MU32 * _mmc_find_slot(mmap_cache * , MU32 , void *, int, int );
+void _mmc_delete_slot(mmap_cache * , MU32 *);
+
+int _mmc_check_expunge(mmap_cache * , int);
+
+int  _mmc_test_page(mmap_cache *);
+int  _mmc_dump_page(mmap_cache *);
+
+

Modified: trunk/libcache-fastmmap-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcache-fastmmap-perl/Changes?rev=20324&op=diff
==============================================================================
--- trunk/libcache-fastmmap-perl/Changes (original)
+++ trunk/libcache-fastmmap-perl/Changes Fri May 23 08:37:20 2008
@@ -1,4 +1,12 @@
 Revision history for Perl extension Cache::FastMmap.
+
+1.26  Thu May 22 14:50 2008
+  - Check for write failure when creating file
+      thanks to Sam Vilain
+  - Check for $ENV{TMP_DIR}
+      thanks to Sam Vilain
+  - Add compress option
+  - Add basic statistics gathering
 
 1.25  Mon Feb 04 13:20 2008
   - Fix multi_set bug and add test

Modified: trunk/libcache-fastmmap-perl/FastMmap.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcache-fastmmap-perl/FastMmap.pm?rev=20324&op=diff
==============================================================================
--- trunk/libcache-fastmmap-perl/FastMmap.pm (original)
+++ trunk/libcache-fastmmap-perl/FastMmap.pm Fri May 23 08:37:20 2008
@@ -196,12 +196,10 @@
 
 How you tune these depends heavily on your setup.
 
-As an interesting point, at least on our setup, we have observed
-a signficant change in behaviour somewhere between Linux 2.6.16 and
-2.6.20. We found that certain machines that were fine under 2.6.16 were
-suddenly experiencing a lot more IO under 2.6.20 that we were able to
-attribute to the Cache::FastMmap files, even though we hadn't changed
-any kernel parameters.
+As an interesting point, if you use a highmem linux kernel, a change
+between 2.6.16 and 2.6.20 made the kernel flush memory a LOT more.
+There's details in this kernel mailing list thread:
+L<http://www.uwsg.iu.edu/hypermail/linux/kernel/0711.3/0804.html>
 
 In most cases, people are not actually concerned about the persistence
 of data in the cache, and so are happy to disable writing of any cache
@@ -221,6 +219,11 @@
 we never run out of real memory, so the cache files effectively act 
 just as named access points to shared memory.
 
+Some people have suggested using anonymous mmaped memory. Unfortunately
+we need a file descriptor to do the fcntl locking on, so we'd have
+to create a separate file on a filesystem somewhere anyway. It seems
+easier to just create an explicit "tmpfs" filesystem.
+
 =head1 PAGE SIZE AND KEY/VALUE LIMITS
 
 To reduce lock contention, Cache::FastMmap breaks up the file
@@ -280,7 +283,7 @@
 use warnings;
 use bytes;
 
-our $VERSION = '1.25';
+our $VERSION = '1.26';
 
 use Cache::FastMmap::CImpl;
 
@@ -315,6 +318,26 @@
 
 Store values as raw binary data rather than using Storable to free/thaw
 data structures (default: 0)
+
+=item * B<compress>
+
+Compress the value (but not the key) before storing into the cache. If
+you set this to 1, the module will attempt to require the Compress::Zlib
+module and then use the memGzip() function on the value data before
+storing into the cache, and memGunzip() when retrieving data from the
+cache. Some initial testing shows that the uncompressing tends to be
+very fast, though the compressing can be quite slow, so it's probably
+best to use this option only if you know values in the cache are long
+lived and have a high hit rate. (default: 0)
+
+=item * B<enable_stats>
+
+Enable some basic statistics capturing. When enabled, every read to
+the cache is counted, and every read to the cache that finds a value
+in the cache is also counted. You can then retrieve these values
+via the get_statistics() call. This causes every read action to
+do a write on a page, which can cause some more IO, so it's
+disabled by default. (default: 0)
 
 =item * B<expire_time>
 
@@ -464,14 +487,16 @@
   # Work out cache file and whether to init
   my $share_file = $Args{share_file};
   if (!$share_file) {
-    $share_file = ($^O eq "MSWin32" ? "c:\\sharefile" : "/tmp/sharefile");
+    my $tmp_dir = $ENV{TMPDIR} || "/tmp";
+    $share_file = ($^O eq "MSWin32" ? "c:\\sharefile" : "$tmp_dir/sharefile");
     $share_file .= "-" . $$ . "-" . time;
   }
   !ref($share_file) || die "share_file argument was a reference";
   $Self->{share_file} = $share_file;
 
-  my $init_file = $Args{init_file} || 0;
-  my $test_file = $Args{test_file} || 0;
+  my $init_file = $Args{init_file} ? 1 : 0;
+  my $test_file = $Args{test_file} ? 1 : 0;
+  my $enable_stats = $Args{enable_stats} ? 1 : 0;
 
   # Worth out unlink default if not specified
   if (!exists $Args{unlink_on_exit}) {
@@ -485,6 +510,15 @@
   if (!$raw_values) {
     eval "use Storable qw(freeze thaw); 1;"
       || die "Could not load Storable module: $@";
+  }
+
+  # Compress stored values?
+  my $compress = $Self->{compress} = int($Args{compress} || 0);
+
+  # Need Compress::Zlib module if using compression
+  if ($compress) {
+    eval "use Compress::Zlib; 1;"
+      || die "Could not load Compress::Zlib module: $@";
   }
 
   # Work out expiry time in seconds
@@ -545,8 +579,8 @@
     = @Args{qw(context read_cb write_cb delete_cb)};
   @$Self{qw(cache_not_found allow_recursive write_back)}
     = (@Args{qw(cache_not_found allow_recursive)}, $write_back);
-  @$Self{qw(empty_on_exit unlink_on_exit)}
-    = @Args{qw(empty_on_exit unlink_on_exit)};
+  @$Self{qw(empty_on_exit unlink_on_exit enable_stats)}
+    = (@Args{qw(empty_on_exit unlink_on_exit)}, $enable_stats);
 
   # Save pid
   $Self->{pid} = $$;
@@ -570,6 +604,7 @@
   $Cache->fc_set_param('expire_time', $expire_time);
   $Cache->fc_set_param('share_file', $share_file);
   $Cache->fc_set_param('start_slots', $start_slots);
+  $Cache->fc_set_param('enable_stats', $enable_stats);
 
   # And initialise it
   $Cache->fc_init();
@@ -622,6 +657,7 @@
 
       # If not using raw values, use freeze() to turn data 
       $Val = freeze(\$Val) if !$Self->{raw_values};
+      $Val = Compress::Zlib::memGzip($Val) if $Self->{compress};
 
       # Get key/value len (we've got 'use bytes'), and do expunge check to
       #  create space if needed
@@ -637,9 +673,8 @@
   $Cache->fc_unlock() unless $_[2] && $_[2]->{skip_unlock};
 
   # If not using raw values, use thaw() to turn data back into object
-  if (!$Self->{raw_values}) {
-    $Val = ${thaw($Val)} if defined $Val;
-  }
+  $Val = Compress::Zlib::memGunzip($Val) if defined($Val) && $Self->{compress};
+  $Val = ${thaw($Val)} if defined($Val) && !$Self->{raw_values};
 
   return $Val;
 }
@@ -662,6 +697,7 @@
 
   # If not using raw values, use freeze() to turn data 
   my $Val = $Self->{raw_values} ? $_[2] : freeze(\$_[2]);
+  $Val = Compress::Zlib::memGzip($Val) if $Self->{compress};
 
   # Get opts, make compatiable with Cache::Cache interface
   my $Opts = defined($_[3]) ? (ref($_[3]) ? $_[3] : { expire_time => $_[3] }) : undef;
@@ -854,12 +890,50 @@
 
   my $Mode = $_[1] || 0;
   return $Cache->fc_get_keys($Mode)
-    if $Mode <= 1 || ($Mode == 2 && $Self->{raw_values});
+    if $Mode <= 1 || ($Mode == 2 && $Self->{raw_values} && !$Self->{compress});
 
   # If we're getting values as well, and they're not raw, unfreeze them
   my @Details = $Cache->fc_get_keys(2);
-  for (@Details) { $_->{value} = ${thaw($_->{value})}; }
+  for (@Details) {
+    if (defined(my $Value = $_->{value})) {
+      $Value = Compress::Zlib::memGunzip($Value) if $Self->{compress};
+      $Value = ${thaw($Value)} if !$Self->{raw_values};
+      $_->{value} = $Value;
+    }
+  }
   return @Details;
+}
+
+=item I<get_statistics($Clear)>
+
+Returns a two value list of (nreads, nreadhits). This
+only works if you passed enable_stats in the constructor
+
+nreads is the total number of read attempts done on the
+cache since it was created
+
+nreadhits is the total number of read attempts done on
+the cache since it was created that found the key/value
+in the cache
+
+If $Clear is true, the values are reset immediately after
+they are retrieved
+
+=cut
+sub get_statistics {
+  my ($Self, $Cache) = ($_[0], $_[0]->{Cache});
+  my $Clear = $_[1];
+
+  my ($NReads, $NReadHits) = (0, 0);
+  for (0 .. $Self->{num_pages}-1) {
+    $Cache->fc_lock($_);
+    my ($PNReads, $PNReadHits) = $Cache->fc_get_page_details();
+    $NReads += $PNReads;
+    $NReadHits += $PNReadHits;
+    $Cache->fc_reset_page_details() if $Clear;
+    $Cache->fc_unlock();
+  }
+  return ($NReads, $NReadHits);
 }
 
 =item I<multi_get($PageKey, [ $Key1, $Key2, ... ])>
@@ -918,7 +992,8 @@
     next unless $Found;
 
     # If not using raw values, use thaw() to turn data back into object
-    $Val = ${thaw($Val)} unless $Self->{raw_values};
+    $Val = Compress::Zlib::memGunzip($Val) if defined($Val) && $Self->{compress};
+    $Val = ${thaw($Val)} if defined($Val) && !$Self->{raw_values};
 
     # Save to return
     $KVs{$_} = $Val;
@@ -952,6 +1027,7 @@
 
     # If not using raw values, use freeze() to turn data 
     $Val = freeze(\$Val) unless $Self->{raw_values};
+    $Val = Compress::Zlib::memGzip($Val) if $Self->{compress};
 
     # Get key/value len (we've got 'use bytes'), and do expunge check to
     #  create space if needed
@@ -961,7 +1037,7 @@
 
     # Now hash key and store into page
     (undef, $HashSlot) = $Cache->fc_hash($FinalKey);
-    $Cache->fc_write($HashSlot, $FinalKey, $Val, $expire_seconds, 0);
+    my $DidStore = $Cache->fc_write($HashSlot, $FinalKey, $Val, $expire_seconds, 0);
   }
 
   # Unlock page
@@ -1074,6 +1150,9 @@
 means you may not connect up to the file you expect. You should be choosing an
 explicit name in most cases.
 
+On Unix systems, you can pass in the environment variable TMPDIR to
+override the default directory of /tmp
+
 =item *
 
 The new option unlink_on_exit defaults to true if you pass a filename for the
@@ -1103,7 +1182,7 @@
 
 =head1 COPYRIGHT AND LICENSE
 
-Copyright (C) 2003-2007 by FastMail IP Partners
+Copyright (C) 2003-2008 by FastMail IP Partners
 
 This library is free software; you can redistribute it and/or modify
 it under the same terms as Perl itself. 

Modified: trunk/libcache-fastmmap-perl/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcache-fastmmap-perl/MANIFEST?rev=20324&op=diff
==============================================================================
--- trunk/libcache-fastmmap-perl/MANIFEST (original)
+++ trunk/libcache-fastmmap-perl/MANIFEST Fri May 23 08:37:20 2008
@@ -17,6 +17,8 @@
 t/10.t
 t/11.t
 t/12.t
+t/13.t
+t/14.t
 t/2.t
 t/3.t
 t/4.t

Modified: trunk/libcache-fastmmap-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcache-fastmmap-perl/META.yml?rev=20324&op=diff
==============================================================================
--- trunk/libcache-fastmmap-perl/META.yml (original)
+++ trunk/libcache-fastmmap-perl/META.yml Fri May 23 08:37:20 2008
@@ -1,7 +1,7 @@
 # http://module-build.sourceforge.net/META-spec.html
 #XXXXXXX This is a prototype!!!  It will change in the future!!! XXXXX#
 name:         Cache-FastMmap
-version:      1.25
+version:      1.26
 version_from: FastMmap.pm
 installdirs:  site
 requires:

Modified: trunk/libcache-fastmmap-perl/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcache-fastmmap-perl/Makefile.PL?rev=20324&op=diff
==============================================================================
--- trunk/libcache-fastmmap-perl/Makefile.PL (original)
+++ trunk/libcache-fastmmap-perl/Makefile.PL Fri May 23 08:37:20 2008
@@ -7,10 +7,10 @@
     'ABSTRACT_FROM' => 'FastMmap.pm',
     'AUTHOR'        => 'Rob Mueller <cpan at robm.fastmail.fm>',
     'PREREQ_PM'     => {
-      'Storable' => 0
+      'Storable' => 0,
     },
     'DIR'           => [
       'Cache-FastMmap-CImpl'
     ],
-#	    'OPTIMIZE' => '-g -DDEBUG',
+	    'OPTIMIZE' => '-g -DDEBUG',
 );

Modified: trunk/libcache-fastmmap-perl/README
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcache-fastmmap-perl/README?rev=20324&op=diff
==============================================================================
--- trunk/libcache-fastmmap-perl/README (original)
+++ trunk/libcache-fastmmap-perl/README Fri May 23 08:37:20 2008
@@ -25,7 +25,7 @@
 
 COPYRIGHT AND LICENCE
 
-Copyright (C) 2003-2007 by FastMail IP Partners
+Copyright (C) 2003-2008 by FastMail IP Partners
 
 This library is free software; you can redistribute it and/or modify
 it under the same terms as Perl itself. 

Modified: trunk/libcache-fastmmap-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcache-fastmmap-perl/debian/changelog?rev=20324&op=diff
==============================================================================
--- trunk/libcache-fastmmap-perl/debian/changelog (original)
+++ trunk/libcache-fastmmap-perl/debian/changelog Fri May 23 08:37:20 2008
@@ -1,3 +1,9 @@
+libcache-fastmmap-perl (1.26-1) UNRELEASED; urgency=low
+
+  * (NOT RELEASED YET) New upstream release
+
+ -- Krzysztof Krzyzaniak (eloy) <eloy at debian.org>  Mon, 04 Feb 2008 13:17:43 +0100
+
 libcache-fastmmap-perl (1.25-1) unstable; urgency=low
 
   * New upstream release




More information about the Pkg-perl-cvs-commits mailing list