You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by st...@apache.org on 2013/02/04 12:27:56 UTC

svn commit: r1442081 - in /subversion/branches/fsfs-format7/subversion/libsvn_fs_fs: dag.c dag.h

Author: stefan2
Date: Mon Feb  4 11:27:56 2013
New Revision: 1442081

URL: http://svn.apache.org/viewvc?rev=1442081&view=rev
Log:
On the fsfs-format7 branch: Improve pool usage during DAG node construction.
Forward the scratch / result pool parameters along the caller chain.

* subversion/libsvn_fs_fs/dag.h
  (svn_fs_fs__dag_dir_entry): distinguish between scratch and result pool

* subversion/libsvn_fs_fs/dag.c
  (svn_fs_fs__dag_dir_entry): update implementation
  (dir_entry_id_from_node): update caller

Modified:
    subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/dag.c
    subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/dag.h

Modified: subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/dag.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/dag.c?rev=1442081&r1=1442080&r2=1442081&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/dag.c (original)
+++ subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/dag.c Mon Feb  4 11:27:56 2013
@@ -314,8 +314,9 @@ dir_entry_id_from_node(const svn_fs_id_t
 {
   svn_fs_dirent_t *dirent;
 
-  SVN_ERR(svn_fs_fs__dag_dir_entry(&dirent, parent, name, scratch_pool));
-  *id_p = dirent ? svn_fs_fs__id_copy(dirent->id, result_pool) : NULL;
+  SVN_ERR(svn_fs_fs__dag_dir_entry(&dirent, parent, name, result_pool,
+                                   scratch_pool));
+  *id_p = dirent ? dirent->id : NULL;
 
   return SVN_NO_ERROR;
 }
@@ -434,7 +435,8 @@ svn_error_t *
 svn_fs_fs__dag_dir_entry(svn_fs_dirent_t **dirent,
                          dag_node_t *node,
                          const char* name,
-                         apr_pool_t *pool)
+                         apr_pool_t *result_pool,
+                         apr_pool_t *scratch_pool)
 {
   node_revision_t *noderev;
   SVN_ERR(get_node_revision(&noderev, node));
@@ -444,8 +446,8 @@ svn_fs_fs__dag_dir_entry(svn_fs_dirent_t
                             _("Can't get entries of non-directory"));
 
   /* Get a dirent hash for this directory. */
-  return svn_fs_fs__rep_contents_dir_entry(dirent, node->fs,
-                                           noderev, name, pool, pool);
+  return svn_fs_fs__rep_contents_dir_entry(dirent, node->fs, noderev, name,
+                                           result_pool, scratch_pool);
 }
 
 

Modified: subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/dag.h
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/dag.h?rev=1442081&r1=1442080&r2=1442081&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/dag.h (original)
+++ subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/dag.h Mon Feb  4 11:27:56 2013
@@ -272,14 +272,16 @@ svn_error_t *svn_fs_fs__dag_dir_entries(
 
 /* Fetches the NODE's entries and returns a copy of the entry selected
    by the key value given in NAME and set *DIRENT to a copy of that
-   entry. If such entry was found, the copy will be allocated in POOL.
+   entry. If such entry was found, the copy will be allocated in
+   RESULT_POOL.  Temporary data will be used in SCRATCH_POOL.
    Otherwise, the *DIRENT will be set to NULL.
  */
 /* ### This function is currently only called from dag.c. */
 svn_error_t * svn_fs_fs__dag_dir_entry(svn_fs_dirent_t **dirent,
                                        dag_node_t *node,
                                        const char* name,
-                                       apr_pool_t *pool);
+                                       apr_pool_t *result_pool,
+                                       apr_pool_t *scratch_pool);
 
 /* Set ENTRY_NAME in NODE to point to ID (with kind KIND), allocating
    from POOL.  NODE must be a mutable directory.  ID can refer to a