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/10/19 22:22:05 UTC
svn commit: r1533819 - in
/subversion/branches/log-addressing/subversion/libsvn_fs_fs: revprops.c
transaction.c
Author: stefan2
Date: Sat Oct 19 20:22:05 2013
New Revision: 1533819
URL: http://svn.apache.org/r1533819
Log:
On the log-addressing branch:
Address violations of our standard iterpools usage / cleanup pattern.
* subversion/libsvn_fs_fs/revprops.c
(serialize_revprops_header): document non-standard pool usage
* subversion/libsvn_fs_fs/transaction.c
(process_changes): ditto
(verify_moves): rename iter_pool to standardized iterpool
Modified:
subversion/branches/log-addressing/subversion/libsvn_fs_fs/revprops.c
subversion/branches/log-addressing/subversion/libsvn_fs_fs/transaction.c
Modified: subversion/branches/log-addressing/subversion/libsvn_fs_fs/revprops.c
URL: http://svn.apache.org/viewvc/subversion/branches/log-addressing/subversion/libsvn_fs_fs/revprops.c?rev=1533819&r1=1533818&r2=1533819&view=diff
==============================================================================
--- subversion/branches/log-addressing/subversion/libsvn_fs_fs/revprops.c (original)
+++ subversion/branches/log-addressing/subversion/libsvn_fs_fs/revprops.c Sat Oct 19 20:22:05 2013
@@ -1112,6 +1112,11 @@ serialize_revprops_header(svn_stream_t *
/* the sizes array */
for (i = start; i < end; ++i)
{
+ /* Non-standard pool usage.
+ *
+ * We only allocate a few bytes each iteration -- even with a
+ * million iterations we would still be in good shape memory-wise.
+ */
apr_off_t size = APR_ARRAY_IDX(sizes, i, apr_off_t);
SVN_ERR(svn_stream_printf(stream, iterpool, "%" APR_OFF_T_FMT "\n",
size));
@@ -1120,7 +1125,7 @@ serialize_revprops_header(svn_stream_t *
/* the double newline char indicates the end of the header */
SVN_ERR(svn_stream_printf(stream, iterpool, "\n"));
-## svn_pool_destroy(iterpool);
+ svn_pool_destroy(iterpool);
return SVN_NO_ERROR;
}
Modified: subversion/branches/log-addressing/subversion/libsvn_fs_fs/transaction.c
URL: http://svn.apache.org/viewvc/subversion/branches/log-addressing/subversion/libsvn_fs_fs/transaction.c?rev=1533819&r1=1533818&r2=1533819&view=diff
==============================================================================
--- subversion/branches/log-addressing/subversion/libsvn_fs_fs/transaction.c (original)
+++ subversion/branches/log-addressing/subversion/libsvn_fs_fs/transaction.c Sat Oct 19 20:22:05 2013
@@ -781,6 +781,9 @@ process_changes(apr_hash_t *changed_path
for (i = 0; i < changes->nelts; ++i)
{
+ /* The ITERPOOL will be cleared at the end of this function
+ * since it is only used rarely and for a single hash iterator.
+ */
change_t *change = APR_ARRAY_IDX(changes, i, change_t *);
SVN_ERR(fold_change(changed_paths, change));
@@ -3212,7 +3215,7 @@ verify_moves(svn_fs_t *fs,
{
apr_hash_t *source_paths = apr_hash_make(pool);
svn_revnum_t revision;
- apr_pool_t *iter_pool = svn_pool_create(pool);
+ apr_pool_t *iterpool = svn_pool_create(pool);
apr_hash_index_t *hi;
int i;
apr_array_header_t *moves
@@ -3296,8 +3299,8 @@ verify_moves(svn_fs_t *fs,
apr_array_header_t *changes;
change_t **changes_p;
- svn_pool_clear(iter_pool);
- svn_fs_fs__get_changes(&changes, fs, revision, iter_pool);
+ svn_pool_clear(iterpool);
+ svn_fs_fs__get_changes(&changes, fs, revision, iterpool);
changes_p = (change_t **)&changes->elts;
for (i = 0; i < changes->nelts; ++i)
@@ -3329,7 +3332,7 @@ verify_moves(svn_fs_t *fs,
}
}
- svn_pool_destroy(iter_pool);
+ svn_pool_destroy(iterpool);
return SVN_NO_ERROR;
}