subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stef...@apache.org
Subject svn commit: r1542881 - /subversion/trunk/subversion/libsvn_subr/object_pool.c
Date Mon, 18 Nov 2013 02:14:54 GMT
Author: stefan2
Date: Mon Nov 18 02:14:53 2013
New Revision: 1542881

URL: http://svn.apache.org/r1542881
Log:
* subversion/libsvn_subr/object_pool.c
  (object_ref_cleanup): enforce immediate object cleanup if no unused objects
                        have been allowed at all

Modified:
    subversion/trunk/subversion/libsvn_subr/object_pool.c

Modified: subversion/trunk/subversion/libsvn_subr/object_pool.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/object_pool.c?rev=1542881&r1=1542880&r2=1542881&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/object_pool.c (original)
+++ subversion/trunk/subversion/libsvn_subr/object_pool.c Mon Nov 18 02:14:53 2013
@@ -237,6 +237,25 @@ object_ref_cleanup(void *baton)
   object_ref_t *object = baton;
   svn_object_pool__t *object_pool = object->object_pool;
 
+  /* if we don't share objects and we are not allowed to hold on to
+   * unused object, delete them immediately. */
+  if (!object_pool->share_objects && object_pool->max_unused == 0)
+    {
+       /* there must only be the one references we are releasing right now */
+      assert(object->ref_count == 1);
+      svn_pool_destroy(object->pool);
+
+      /* see below for a more info on this final cleanup check */
+      if (   svn_atomic_dec(&object_pool->used_count) == 0
+          && svn_atomic_cas(&object_pool->ready_for_cleanup, FALSE, TRUE)
+             == TRUE)
+        {
+          destroy_object_pool(object_pool);
+        }
+
+     return APR_SUCCESS;
+    }
+
   SVN_INT_ERR(svn_mutex__lock(object_pool->mutex));
 
   /* put back into "available" container */



Mime
View raw message