subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stef...@apache.org
Subject svn commit: r1568599 - /subversion/trunk/subversion/libsvn_subr/cache-membuffer.c
Date Sat, 15 Feb 2014 09:44:34 GMT
Author: stefan2
Date: Sat Feb 15 09:44:34 2014
New Revision: 1568599

URL: http://svn.apache.org/r1568599
Log:
In the membuffer cache code, fix the L1->L2 promotion / eviction heuristics
for high hit count entries.  This is an efficiency not a correctness fix.

* subversion/libsvn_subr/cache-membuffer.c
  (ensure_data_insertable_l2): Make sure we use the full 64 bits of the
                               32x32 bit multiplications.

Modified:
    subversion/trunk/subversion/libsvn_subr/cache-membuffer.c

Modified: subversion/trunk/subversion/libsvn_subr/cache-membuffer.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/cache-membuffer.c?rev=1568599&r1=1568598&r2=1568599&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/cache-membuffer.c (original)
+++ subversion/trunk/subversion/libsvn_subr/cache-membuffer.c Sat Feb 15 09:44:34 2014
@@ -1449,10 +1449,10 @@ ensure_data_insertable_l2(svn_membuffer_
                * or is smaller than the one to insert - both relative to
                * their respective priority.
                */
-              keep = to_fit_in->hit_count * to_fit_in->priority
-                   < entry->hit_count * entry->priority
-                  || to_fit_in->size * to_fit_in->priority
-                   < entry->size * entry->priority;
+              keep = (apr_uint64_t)to_fit_in->hit_count * to_fit_in->priority
+                   < (apr_uint64_t)entry->hit_count * entry->priority
+                  || (apr_uint64_t)to_fit_in->size * to_fit_in->priority
+                   < (apr_uint64_t)entry->size * entry->priority;
             }
           else if (cache->hit_count > cache->used_entries)
             {



Mime
View raw message