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 12:30:04 UTC
svn commit: r1652581 - in /subversion/trunk/subversion/libsvn_fs_x: dag.c
dag.h tree.c
Author: stefan2
Date: Sat Jan 17 11:30:03 2015
New Revision: 1652581
URL: http://svn.apache.org/r1652581
Log:
In FSX/dag.c, switch make_entry() to the 2-pool paradigm.
Propagate that change along the call stack.
* subversion/libsvn_fs_x/dag.c
(make_entry): Use two pools now.
(svn_fs_x__dag_make_file,
svn_fs_x__dag_make_dir): Do the same to the pass-through callers.
* subversion/libsvn_fs_x/dag.h
(svn_fs_x__dag_make_file,
svn_fs_x__dag_make_dir): Update declarations to match the implementation.
* subversion/libsvn_fs_x/tree.c
(x_make_dir,
x_make_file): Update callers.
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=1652581&r1=1652580&r2=1652581&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_x/dag.c (original)
+++ subversion/trunk/subversion/libsvn_fs_x/dag.c Sat Jan 17 11:30:03 2015
@@ -414,10 +414,10 @@ set_entry(dag_node_t *parent,
/* Make a new entry named NAME in PARENT. If IS_DIR is true, then the
node revision the new entry points to will be a directory, else it
- will be a file. The new node will be allocated in POOL. PARENT
+ will be a file. The new node will be allocated in RESULT_POOL. PARENT
must be mutable, and must not have an entry named NAME.
- Use POOL for all allocations, except caching the node_revision in PARENT.
+ Use SCRATCH_POOL for all temporary allocations.
*/
static svn_error_t *
make_entry(dag_node_t **child_p,
@@ -426,7 +426,8 @@ make_entry(dag_node_t **child_p,
const char *name,
svn_boolean_t is_dir,
svn_fs_x__txn_id_t txn_id,
- apr_pool_t *pool)
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
{
svn_fs_x__noderev_t new_noderev, *parent_noderev;
@@ -451,10 +452,10 @@ make_entry(dag_node_t **child_p,
/* Create the new node's NODE-REVISION */
memset(&new_noderev, 0, sizeof(new_noderev));
new_noderev.kind = is_dir ? svn_node_dir : svn_node_file;
- new_noderev.created_path = svn_fspath__join(parent_path, name, pool);
+ new_noderev.created_path = svn_fspath__join(parent_path, name, result_pool);
SVN_ERR(get_node_revision(&parent_noderev, parent));
- new_noderev.copyroot_path = apr_pstrdup(pool,
+ new_noderev.copyroot_path = apr_pstrdup(result_pool,
parent_noderev->copyroot_path);
new_noderev.copyroot_rev = parent_noderev->copyroot_rev;
new_noderev.copyfrom_rev = SVN_INVALID_REVNUM;
@@ -463,17 +464,17 @@ make_entry(dag_node_t **child_p,
SVN_ERR(svn_fs_x__create_node
(svn_fs_x__dag_get_fs(parent), &new_noderev,
- &parent_noderev->copy_id, txn_id, pool));
+ &parent_noderev->copy_id, txn_id, scratch_pool));
/* Create a new dag_node_t for our new node */
SVN_ERR(svn_fs_x__dag_get_node(child_p, svn_fs_x__dag_get_fs(parent),
- &new_noderev.noderev_id, pool));
+ &new_noderev.noderev_id, result_pool));
/* We can safely call set_entry because we already know that
PARENT is mutable, and we just created CHILD, so we know it has
no ancestors (therefore, PARENT cannot be an ancestor of CHILD) */
return set_entry(parent, name, &new_noderev.noderev_id,
- new_noderev.kind, txn_id, pool);
+ new_noderev.kind, txn_id, scratch_pool);
}
@@ -907,10 +908,12 @@ svn_fs_x__dag_make_file(dag_node_t **chi
const char *parent_path,
const char *name,
svn_fs_x__txn_id_t txn_id,
- apr_pool_t *pool)
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
{
/* Call our little helper function */
- return make_entry(child_p, parent, parent_path, name, FALSE, txn_id, pool);
+ return make_entry(child_p, parent, parent_path, name, FALSE, txn_id,
+ result_pool, scratch_pool);
}
@@ -920,10 +923,12 @@ svn_fs_x__dag_make_dir(dag_node_t **chil
const char *parent_path,
const char *name,
svn_fs_x__txn_id_t txn_id,
- apr_pool_t *pool)
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
{
/* Call our little helper function */
- return make_entry(child_p, parent, parent_path, name, TRUE, txn_id, pool);
+ return make_entry(child_p, parent, parent_path, name, TRUE, txn_id,
+ 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=1652581&r1=1652580&r2=1652581&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_x/dag.h (original)
+++ subversion/trunk/subversion/libsvn_fs_x/dag.h Sat Jan 17 11:30:03 2015
@@ -385,7 +385,7 @@ svn_fs_x__dag_delete(dag_node_t *parent,
/* Create a new mutable directory named NAME in PARENT. Set *CHILD_P
- to a reference to the new node, allocated in POOL. The new
+ to a reference to the new node, allocated in RESULT_POOL. The new
directory has no contents, and no properties. PARENT must be
mutable. NAME must be a single path component; it cannot be a
slash-separated directory path. PARENT_PATH must be the
@@ -393,7 +393,7 @@ svn_fs_x__dag_delete(dag_node_t *parent,
not currently have an entry named NAME. TXN_ID is the Subversion
transaction under which this occurs.
- Use POOL for all allocations.
+ Use SCRATCH_POOL for temporary allocations.
*/
svn_error_t *
svn_fs_x__dag_make_dir(dag_node_t **child_p,
@@ -401,7 +401,8 @@ svn_fs_x__dag_make_dir(dag_node_t **chil
const char *parent_path,
const char *name,
svn_fs_x__txn_id_t txn_id,
- apr_pool_t *pool);
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool);
@@ -496,14 +497,14 @@ svn_fs_x__dag_file_checksum(svn_checksum
apr_pool_t *result_pool);
/* Create a new mutable file named NAME in PARENT. Set *CHILD_P to a
- reference to the new node, allocated in POOL. The new file's
+ reference to the new node, allocated in RESULT_POOL. The new file's
contents are the empty string, and it has no properties. PARENT
must be mutable. NAME must be a single path component; it cannot
be a slash-separated directory path. PARENT_PATH must be the
canonicalized absolute path of the parent directory. TXN_ID is the
Subversion transaction under which this occurs.
- Use POOL for all allocations.
+ Use SCRATCH_POOL for temporary allocations.
*/
svn_error_t *
svn_fs_x__dag_make_file(dag_node_t **child_p,
@@ -511,7 +512,8 @@ svn_fs_x__dag_make_file(dag_node_t **chi
const char *parent_path,
const char *name,
svn_fs_x__txn_id_t txn_id,
- apr_pool_t *pool);
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool);
Modified: subversion/trunk/subversion/libsvn_fs_x/tree.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_x/tree.c?rev=1652581&r1=1652580&r2=1652581&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_x/tree.c (original)
+++ subversion/trunk/subversion/libsvn_fs_x/tree.c Sat Jan 17 11:30:03 2015
@@ -2433,7 +2433,7 @@ x_make_dir(svn_fs_root_t *root,
subpool),
parent_path->entry,
txn_id,
- subpool));
+ subpool, subpool));
/* Add this directory to the path cache. */
SVN_ERR(dag_node_cache_set(root, parent_path_path(parent_path, subpool),
@@ -2771,7 +2771,7 @@ x_make_file(svn_fs_root_t *root,
subpool),
parent_path->entry,
txn_id,
- subpool));
+ subpool, subpool));
/* Add this file to the path cache. */
SVN_ERR(dag_node_cache_set(root, parent_path_path(parent_path, subpool),