You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by hw...@apache.org on 2011/04/05 23:06:52 UTC

svn commit: r1089223 - /subversion/trunk/subversion/libsvn_wc/wc_db.c

Author: hwright
Date: Tue Apr  5 21:06:51 2011
New Revision: 1089223

URL: http://svn.apache.org/viewvc?rev=1089223&view=rev
Log:
Add an iterpool to limit memory growth.

* subversion/libsvn_wc/wc_db.c
  (svn_wc__db_revert_list_notify): Add and use an iterpool during notification.

Modified:
    subversion/trunk/subversion/libsvn_wc/wc_db.c

Modified: subversion/trunk/subversion/libsvn_wc/wc_db.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.c?rev=1089223&r1=1089222&r2=1089223&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.c Tue Apr  5 21:06:51 2011
@@ -3968,9 +3968,10 @@ svn_wc__db_revert_list_notify(svn_wc_not
   const char *local_relpath, *like_arg;
   svn_sqlite__stmt_t *stmt;
   svn_boolean_t have_row;
+  apr_pool_t *iterpool = svn_pool_create(scratch_pool);
 
   SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath,
-                              db, local_abspath, scratch_pool, scratch_pool));
+                              db, local_abspath, scratch_pool, iterpool));
   VERIFY_USABLE_WCROOT(wcroot);
 
   like_arg = construct_like_arg(local_relpath, scratch_pool);
@@ -3985,15 +3986,18 @@ svn_wc__db_revert_list_notify(svn_wc_not
     {
       const char *notify_relpath = svn_sqlite__column_text(stmt, 0, NULL);
 
+      svn_pool_clear(iterpool);
+
       if (svn_sqlite__column_int64(stmt, 1))
         {
           const char *notify_abspath = svn_dirent_join(wcroot->abspath,
                                                        notify_relpath,
-                                                       scratch_pool);
+                                                       iterpool);
           notify_func(notify_baton,
-                      svn_wc_create_notify(notify_abspath, svn_wc_notify_revert,
-                                           scratch_pool),
-                      scratch_pool);
+                      svn_wc_create_notify(notify_abspath,
+                                           svn_wc_notify_revert,
+                                           iterpool),
+                      iterpool);
 
           /* ### Need cancel_func? */
         }
@@ -4006,6 +4010,8 @@ svn_wc__db_revert_list_notify(svn_wc_not
   SVN_ERR(svn_sqlite__bindf(stmt, "ss", local_relpath, like_arg));
   SVN_ERR(svn_sqlite__step_done(stmt));
 
+  svn_pool_destroy(iterpool);
+
   return SVN_NO_ERROR;
 }