[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

[PATCH] Fix svn_io_remove_dir pool usage

From: Eric Gillespie <epg_at_pretzelnet.org>
Date: 2004-11-01 00:42:12 CET

This passes the smoke test of allowing my massive import. If it
passes the test suite and no one objects, i'll commit this.

Memory usage for svn_io_remove_dir was going through the roof when
removing a large directory (e.g. bumping into a 128 MB resource limit
in svn_fs_fs__purge_txn when committing 89482 files). Fix its pool
usage to avoid this.

* subversion/libsvn_subr/io.c
  (svn_io_remove_dir): Allocate path_apr and this_dir directly in the
  input pool instead of the subpool. Use subpool instead of pool in
  the loop, clearing it on each iteration.

Index: subversion/libsvn_subr/io.c
===================================================================
--- subversion/libsvn_subr/io.c (revision 11677)
+++ subversion/libsvn_subr/io.c (working copy)
@@ -1445,9 +1445,9 @@
      instead of just using svn_io_dir_open, because we're going to
      need path_apr later anyway when we remove the dir itself. */
 
- SVN_ERR (svn_path_cstring_from_utf8 (&path_apr, path, subpool));
+ SVN_ERR (svn_path_cstring_from_utf8 (&path_apr, path, pool));
 
- status = apr_dir_open (&this_dir, path_apr, subpool);
+ status = apr_dir_open (&this_dir, path_apr, pool);
   if (status)
     return svn_error_wrap_apr (status, _("Can't open directory '%s'"), path);
 
@@ -1455,6 +1455,7 @@
        status == APR_SUCCESS;
        status = apr_dir_read (&this_entry, flags, this_dir))
     {
+ svn_pool_clear (subpool);
       if ((this_entry.filetype == APR_DIR)
           && ((this_entry.name[0] == '.')
               && ((this_entry.name[1] == '\0')
@@ -1470,7 +1471,7 @@
           SVN_ERR (svn_path_cstring_to_utf8 (&entry_utf8, this_entry.name,
                                              subpool));
           
- fullpath = svn_path_join (path, entry_utf8, pool);
+ fullpath = svn_path_join (path, entry_utf8, subpool);
 
           if (this_entry.filetype == APR_DIR)
             {

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Mon Nov 1 00:42:43 2004

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.