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 2015/01/17 23:01:03 UTC
svn commit: r1652683 - in /subversion/trunk/subversion/libsvn_fs_x: dag.c
dag.h tree.c
Author: stefan2
Date: Sat Jan 17 22:01:03 2015
New Revision: 1652683
URL: http://svn.apache.org/r1652683
Log:
Switch svn_fs_x__dag_dir_entries to using the 2-pool paradigm.
* subversion/libsvn_fs_x/dag.h
(svn_fs_x__dag_dir_entries): Change the signature to the new paradigm.
* subversion/libsvn_fs_x/dag.c
(svn_fs_x__dag_dir_entries): The pool parameters are simple pass-throughs.
* subversion/libsvn_fs_x/tree.c
(compare_dir_structure,
merge,
crawl_directory_dag_for_mergeinfo,
verify_node): Update callers. Theye all have a handy ITERPOOL that
we can hijack for very short-lived allocations.
Modified:
subversion/trunk/subversion/libsvn_fs_x/dag.c
subversion/trunk/subversion/libsvn_fs_x/dag.h
subversion/trunk/subversion/libsvn_fs_x/tree.c
Modified: subversion/trunk/subversion/libsvn_fs_x/dag.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_x/dag.c?rev=1652683&r1=1652682&r2=1652683&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_x/dag.c (original)
+++ subversion/trunk/subversion/libsvn_fs_x/dag.c Sat Jan 17 22:01:03 2015
@@ -481,7 +481,8 @@ make_entry(dag_node_t **child_p,
svn_error_t *
svn_fs_x__dag_dir_entries(apr_array_header_t **entries,
dag_node_t *node,
- apr_pool_t *pool)
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
{
svn_fs_x__noderev_t *noderev;
@@ -491,7 +492,8 @@ svn_fs_x__dag_dir_entries(apr_array_head
return svn_error_create(SVN_ERR_FS_NOT_DIRECTORY, NULL,
_("Can't get entries of non-directory"));
- return svn_fs_x__rep_contents_dir(entries, node->fs, noderev, pool, pool);
+ return svn_fs_x__rep_contents_dir(entries, node->fs, noderev, result_pool,
+ scratch_pool);
}
Modified: subversion/trunk/subversion/libsvn_fs_x/dag.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_x/dag.h?rev=1652683&r1=1652682&r2=1652683&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_x/dag.h (original)
+++ subversion/trunk/subversion/libsvn_fs_x/dag.h Sat Jan 17 22:01:03 2015
@@ -315,11 +315,12 @@ svn_fs_x__dag_open(dag_node_t **child_p,
/* Set *ENTRIES_P to an array of NODE's entries, sorted by entry names,
and the values are svn_fs_x__dirent_t. The returned table (and elements)
- is allocated in POOL, which is also used for temporary allocations. */
+ is allocated in RESULT_POOL, temporaries in SCRATCH_POOL. */
svn_error_t *
svn_fs_x__dag_dir_entries(apr_array_header_t **entries_p,
dag_node_t *node,
- 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
Modified: subversion/trunk/subversion/libsvn_fs_x/tree.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_x/tree.c?rev=1652683&r1=1652682&r2=1652683&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_x/tree.c (original)
+++ subversion/trunk/subversion/libsvn_fs_x/tree.c Sat Jan 17 22:01:03 2015
@@ -1669,8 +1669,10 @@ compare_dir_structure(svn_boolean_t *cha
int i;
apr_pool_t *iterpool = svn_pool_create(scratch_pool);
- SVN_ERR(svn_fs_x__dag_dir_entries(&lhs_entries, lhs, scratch_pool));
- SVN_ERR(svn_fs_x__dag_dir_entries(&rhs_entries, rhs, scratch_pool));
+ SVN_ERR(svn_fs_x__dag_dir_entries(&lhs_entries, lhs, scratch_pool,
+ iterpool));
+ SVN_ERR(svn_fs_x__dag_dir_entries(&rhs_entries, rhs, scratch_pool,
+ iterpool));
/* Since directories are sorted by name, we can simply compare their
entries one-by-one without binary lookup etc. */
@@ -1917,12 +1919,12 @@ merge(svn_stringbuf_t *conflict_p,
/* ### todo: it would be more efficient to simply check for a NULL
entries hash where necessary below than to allocate an empty hash
here, but another day, another day... */
- SVN_ERR(svn_fs_x__dag_dir_entries(&s_entries, source, pool));
- SVN_ERR(svn_fs_x__dag_dir_entries(&t_entries, target, pool));
- SVN_ERR(svn_fs_x__dag_dir_entries(&a_entries, ancestor, pool));
+ iterpool = svn_pool_create(pool);
+ SVN_ERR(svn_fs_x__dag_dir_entries(&s_entries, source, pool, iterpool));
+ SVN_ERR(svn_fs_x__dag_dir_entries(&t_entries, target, pool, iterpool));
+ SVN_ERR(svn_fs_x__dag_dir_entries(&a_entries, ancestor, pool, iterpool));
/* for each entry E in a_entries... */
- iterpool = svn_pool_create(pool);
for (i = 0; i < a_entries->nelts; ++i)
{
svn_fs_x__dirent_t *s_entry, *t_entry, *a_entry;
@@ -3827,7 +3829,8 @@ crawl_directory_dag_for_mergeinfo(svn_fs
int i;
apr_pool_t *iterpool = svn_pool_create(scratch_pool);
- SVN_ERR(svn_fs_x__dag_dir_entries(&entries, dir_dag, scratch_pool));
+ SVN_ERR(svn_fs_x__dag_dir_entries(&entries, dir_dag, scratch_pool,
+ iterpool));
for (i = 0; i < entries->nelts; ++i)
{
svn_fs_x__dirent_t *dirent = APR_ARRAY_IDX(entries, i, svn_fs_x__dirent_t *);
@@ -4378,7 +4381,8 @@ verify_node(dag_node_t *node,
apr_int64_t children_mergeinfo = 0;
APR_ARRAY_PUSH(parent_nodes, dag_node_t*) = node;
- SVN_ERR(svn_fs_x__dag_dir_entries(&entries, node, scratch_pool));
+ SVN_ERR(svn_fs_x__dag_dir_entries(&entries, node, scratch_pool,
+ iterpool));
/* Compute CHILDREN_MERGEINFO. */
for (i = 0; i < entries->nelts; ++i)