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/07/25 15:58:03 UTC

svn commit: r1506971 - in /subversion/branches/fsfs-improvements/subversion/libsvn_fs_fs: dag.c dag.h

Author: stefan2
Date: Thu Jul 25 13:58:03 2013
New Revision: 1506971

URL: http://svn.apache.org/r1506971
Log:
On the fsfs-improvement branch:  Fix a pool handling inefficency.

* subversion/libsvn_fs_fs/dag.h
  (svn_fs_fs__dag_dir_entry): switch from 1 to 2-pool ideom

* subversion/libsvn_fs_fs/dag.c
  (dir_entry_id_from_node): update caller; eliminate ID copy
  (svn_fs_fs__dag_dir_entry): pass extra pool through

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

Modified: subversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/dag.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/dag.c?rev=1506971&r1=1506970&r2=1506971&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/dag.c (original)
+++ subversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/dag.c Thu Jul 25 13:58:03 2013
@@ -313,8 +313,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;
 }
@@ -433,7 +434,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));
@@ -443,8 +445,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-improvements/subversion/libsvn_fs_fs/dag.h
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/dag.h?rev=1506971&r1=1506970&r2=1506971&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/dag.h (original)
+++ subversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/dag.h Thu Jul 25 13:58:03 2013
@@ -274,14 +274,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