You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by da...@apache.org on 2012/03/24 17:31:33 UTC

svn commit: r1304851 - in /subversion/branches/node_pool/subversion/libsvn_fs_fs: dag.c dag.h

Author: danielsh
Date: Sat Mar 24 16:31:32 2012
New Revision: 1304851

URL: http://svn.apache.org/viewvc?rev=1304851&view=rev
Log:
Eliminate the DAG API's NODE_POOL, step 3.2.

Remove another NODE_POOL parameter.

* subversion/libsvn_fs_fs/dag.h
* subversion/libsvn_fs_fs/dag.c
  (svn_fs_fs__dag_dir_entry): Remove POOL argument.
  (dir_entry_id_from_node): Switch to the dual-pool paradigm,
    instead of creating/destroying a single-call subpool.
  (svn_fs_fs__dag_open): Track signature change.

Modified:
    subversion/branches/node_pool/subversion/libsvn_fs_fs/dag.c
    subversion/branches/node_pool/subversion/libsvn_fs_fs/dag.h

Modified: subversion/branches/node_pool/subversion/libsvn_fs_fs/dag.c
URL: http://svn.apache.org/viewvc/subversion/branches/node_pool/subversion/libsvn_fs_fs/dag.c?rev=1304851&r1=1304850&r2=1304851&view=diff
==============================================================================
--- subversion/branches/node_pool/subversion/libsvn_fs_fs/dag.c (original)
+++ subversion/branches/node_pool/subversion/libsvn_fs_fs/dag.c Sat Mar 24 16:31:32 2012
@@ -307,15 +307,13 @@ static svn_error_t *
 dir_entry_id_from_node(const svn_fs_id_t **id_p,
                        dag_node_t *parent,
                        const char *name,
-                       apr_pool_t *pool)
+                       apr_pool_t *scratch_pool,
+                       apr_pool_t *result_pool)
 {
   svn_fs_dirent_t *dirent;
-  apr_pool_t *subpool = svn_pool_create(pool);
 
-  SVN_ERR(svn_fs_fs__dag_dir_entry(&dirent, parent, name, subpool, pool));
-  *id_p = dirent ? svn_fs_fs__id_copy(dirent->id, pool) : NULL;
-
-  svn_pool_destroy(subpool);
+  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;
 
   return SVN_NO_ERROR;
 }
@@ -434,8 +432,7 @@ 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 *node_pool)
+                         apr_pool_t *pool)
 {
   node_revision_t *noderev;
   SVN_ERR(get_node_revision(&noderev, node));
@@ -1146,7 +1143,7 @@ svn_fs_fs__dag_open(dag_node_t **child_p
   const svn_fs_id_t *node_id;
 
   /* Ensure that NAME exists in PARENT's entry list. */
-  SVN_ERR(dir_entry_id_from_node(&node_id, parent, name, pool));
+  SVN_ERR(dir_entry_id_from_node(&node_id, parent, name, pool, pool));
   if (! node_id)
     return svn_error_createf
       (SVN_ERR_FS_NOT_FOUND, NULL,

Modified: subversion/branches/node_pool/subversion/libsvn_fs_fs/dag.h
URL: http://svn.apache.org/viewvc/subversion/branches/node_pool/subversion/libsvn_fs_fs/dag.h?rev=1304851&r1=1304850&r2=1304851&view=diff
==============================================================================
--- subversion/branches/node_pool/subversion/libsvn_fs_fs/dag.h (original)
+++ subversion/branches/node_pool/subversion/libsvn_fs_fs/dag.h Sat Mar 24 16:31:32 2012
@@ -278,14 +278,13 @@ 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.
-   Otherwise, the *DIRENT will be set to NULL. NODE_POOL is used for
-   any allocation of memory that needs to live as long as NODE lives.
+   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 *node_pool);
+                                       apr_pool_t *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