Author: rhuijben
Date: Mon May  2 16:50:05 2011
New Revision: 1098657

URL: http://svn.apache.org/viewvc?rev=1098657&view=rev
Log:
* subversion/tests/svn_test_main.c
  (main): Setup the primary pool like we do in svn, to reduce memory
    fragmentation a bit on tests using a lot of ram.

Modified:
    subversion/trunk/subversion/tests/svn_test_main.c

Modified: subversion/trunk/subversion/tests/svn_test_main.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/svn_test_main.c?rev=1098657&r1=1098656&r2=1098657&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/svn_test_main.c (original)
+++ subversion/trunk/subversion/tests/svn_test_main.c Mon May  2 16:50:05 2011
@@ -355,6 +355,7 @@ main(int argc, const char *argv[])
   const char *prog_name;
   int i;
   svn_boolean_t got_error = FALSE;
+  apr_allocator_t *allocator;
   apr_pool_t *pool, *test_pool;
   svn_boolean_t ran_a_test = FALSE;
   svn_boolean_t list_mode = FALSE;
@@ -377,8 +378,16 @@ main(int argc, const char *argv[])
       exit(1);
     }
 
-  /* set up the global pool */
-  pool = svn_pool_create(NULL);
+  /* set up the global pool.  Use a separate mutexless allocator,
+   * given this application is single threaded.
+   */
+  if (apr_allocator_create(&allocator))
+    return EXIT_FAILURE;
+
+  apr_allocator_max_free_set(allocator, SVN_ALLOCATOR_RECOMMENDED_MAX_FREE);
+
+  pool = svn_pool_create_ex(NULL, allocator);
+  apr_allocator_owner_set(allocator, pool);
 
   /* Remember the command line */
   test_argc = argc;


Reply via email to