subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stef...@apache.org
Subject svn commit: r1714356 - /subversion/trunk/subversion/libsvn_subr/cache-membuffer.c
Date Sat, 14 Nov 2015 19:52:23 GMT
Author: stefan2
Date: Sat Nov 14 19:52:23 2015
New Revision: 1714356

URL: http://svn.apache.org/viewvc?rev=1714356&view=rev
Log:
Fix capacity check in the membuffer cache's prefix pool.
The current implementation used only about 1% of its capacity.

* subversion/libsvn_subr/cache-membuffer.c
  (prefix_pool_get_internal): Actually check byte usage against bytes
                              limit - not entry count limit.

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=1714356&r1=1714355&r2=1714356&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/cache-membuffer.c (original)
+++ subversion/trunk/subversion/libsvn_subr/cache-membuffer.c Sat Nov 14 19:52:23 2015
@@ -353,7 +353,8 @@ prefix_pool_get_internal(apr_uint32_t *p
     }
 
   bytes_needed = prefix_len + 1 + OVERHEAD;
-  if (prefix_pool->bytes_used + bytes_needed > prefix_pool->values_max)
+  assert(prefix_pool->bytes_max >= prefix_pool->bytes_used);
+  if (prefix_pool->bytes_max - prefix_pool->bytes_used > bytes_needed)
     {
       *prefix_idx = NO_INDEX;
       return SVN_NO_ERROR;



Mime
View raw message