subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stef...@apache.org
Subject svn commit: r1400670 - /subversion/trunk/subversion/libsvn_subr/cache-membuffer.c
Date Sun, 21 Oct 2012 16:16:17 GMT
Author: stefan2
Date: Sun Oct 21 16:16:17 2012
New Revision: 1400670

URL: http://svn.apache.org/viewvc?rev=1400670&view=rev
Log:
Fix a bug introduced in r1393252: ensure_data_insertable may drop old
entries from the same bucket. Because we always add new entries at the
end of the bucket, we can select that entry only *after* the number of
used (surviving) entries is known.

* subversion/libsvn_subr/cache-membuffer.c
  (membuffer_cache_set_partial_internal): select entry after dropping others

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=1400670&r1=1400669&r2=1400670&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/cache-membuffer.c (original)
+++ subversion/trunk/subversion/libsvn_subr/cache-membuffer.c Sun Oct 21 16:16:17 2012
@@ -1753,12 +1753,12 @@ membuffer_cache_set_partial_internal(svn
             {
               /* Remove the old entry and try to make space for the new one.
                */
-              entry = find_entry(cache, group_index, to_find, TRUE);
               if (   (cache->max_entry_size >= size)
                   && ensure_data_insertable(cache, size))
                 {
                   /* Write the new entry.
                    */
+                  entry = find_entry(cache, group_index, to_find, TRUE);
                   entry->size = size;
                   entry->offset = cache->current_data;
                   if (size)



Mime
View raw message