You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by st...@apache.org on 2013/02/04 10:34:08 UTC

svn commit: r1442054 - /subversion/trunk/subversion/libsvn_subr/cache-membuffer.c

Author: stefan2
Date: Mon Feb  4 09:34:07 2013
New Revision: 1442054

URL: http://svn.apache.org/viewvc?rev=1442054&view=rev
Log:
Minor membuffer cache optimization.

* subversion/libsvn_subr/cache-membuffer.c
  (svn_membuffer_cache_get,
   svn_membuffer_cache_get_partial): no need to clear our scratch pool
   here because we don't use it in the getters

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=1442054&r1=1442053&r2=1442054&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/cache-membuffer.c (original)
+++ subversion/trunk/subversion/libsvn_subr/cache-membuffer.c Mon Feb  4 09:34:07 2013
@@ -1970,16 +1970,6 @@ svn_membuffer_cache_get(void **value_p,
                               DEBUG_CACHE_MEMBUFFER_TAG
                               result_pool));
 
-  /* We don't need more the key anymore.
-   * But since we allocate only small amounts of data per get() call and
-   * apr_pool_clear is somewhat expensive, we clear it only now and then.
-   */
-  if (++cache->alloc_counter > ALLOCATIONS_PER_POOL_CLEAR)
-    {
-      svn_pool_clear(cache->pool);
-      cache->alloc_counter = 0;
-    }
-
   /* return result */
   *found = *value_p != NULL;
   return SVN_NO_ERROR;
@@ -2063,12 +2053,6 @@ svn_membuffer_cache_get_partial(void **v
       return SVN_NO_ERROR;
     }
 
-  if (++cache->alloc_counter > ALLOCATIONS_PER_POOL_CLEAR)
-    {
-      svn_pool_clear(cache->pool);
-      cache->alloc_counter = 0;
-    }
-
   combine_key(cache, key, cache->key_len);
   SVN_ERR(membuffer_cache_get_partial(cache->membuffer,
                                       cache->combined_key,