subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1166112 - /subversion/branches/fs-successor-ids/subversion/libsvn_fs_fs/fs_fs.c
Date Wed, 07 Sep 2011 11:05:07 GMT
Author: stsp
Date: Wed Sep  7 11:05:06 2011
New Revision: 1166112

URL: http://svn.apache.org/viewvc?rev=1166112&view=rev
Log:
On the fs-successor-ids branch, resolve a pool life time bug.

* subversion/libsvn_fs_fs/fs_fs.c
  (update_successor_node_revs_files): Allocate keys for the returned hash
   table in the result pool, rather than in the iterpool.
   The caller relies on getting the keys while iterating the hash table.
   Add comments which document expected pool lifetime for returned results.

Modified:
    subversion/branches/fs-successor-ids/subversion/libsvn_fs_fs/fs_fs.c

Modified: subversion/branches/fs-successor-ids/subversion/libsvn_fs_fs/fs_fs.c
URL: http://svn.apache.org/viewvc/subversion/branches/fs-successor-ids/subversion/libsvn_fs_fs/fs_fs.c?rev=1166112&r1=1166111&r2=1166112&view=diff
==============================================================================
--- subversion/branches/fs-successor-ids/subversion/libsvn_fs_fs/fs_fs.c (original)
+++ subversion/branches/fs-successor-ids/subversion/libsvn_fs_fs/fs_fs.c Wed Sep  7 11:05:06
2011
@@ -6089,7 +6089,9 @@ update_successor_node_revs_files(apr_has
 
       svn_pool_clear(iterpool);
       
-      node_revs_file_abspath = path_successor_node_revs(fs, pred, iterpool);
+      /* This string will be obtained by the caller when iterating over
+       * the NODE_REV_TEMPILES hash so we allocate it in the result pool. */
+      node_revs_file_abspath = path_successor_node_revs(fs, pred, pool);
       if (apr_hash_get(tempfiles, node_revs_file_abspath,
                        APR_HASH_KEY_STRING) == NULL)
         {
@@ -6100,6 +6102,8 @@ update_successor_node_revs_files(apr_has
           svn_error_t *err;
           const char *dirname = svn_dirent_dirname(node_revs_file_abspath,
                                                    iterpool);
+          /* This tempfile is also used by the loops below so we
+           * must not allocate it in the iterpool. */
           SVN_ERR(svn_io_open_unique_file3(&tempfile, NULL, dirname,
                                            svn_io_file_del_none, pool,
                                            iterpool));



Mime
View raw message