Use of a NULL pool with apr_hash_first() is fine so long as your
apr_hash_t is only accessed by one thread at a time. Is that the case
here?
On Sat, 07 Oct 2006, Kamesh Jayachandran wrote:
> Hi All,
> Found a snippet of code in subversion/libsvn_fs_base/tree.c where we
> create a separate subpool which is passed to apr_hash_first alone. And
> this subpool can be replaced by NULL.
> With this change I ran 'make check FS_TYPE=bdb' and observed same
> behaviour without this change.
>
> Can someone consider this patch?
>
> With regards
> Kamesh Jayachandran
> [[[
> Patch by: Kamesh Jayachandran <kamesh@collab.net>
>
> Why to create subpool to iterate the apr_hash_t rather iterate with
> a NULL as pool.
>
> * subversion/libsvn_fs_base/tree.c
> (base_dir_entries):
> Don't create subpool to iterate over the apr_hash_t rather pass NULL as
> pool to apr_hash_first.
>
> ]]]
> Index: subversion/libsvn_fs_base/tree.c
> ===================================================================
> --- subversion/libsvn_fs_base/tree.c (revision 21795)
> +++ subversion/libsvn_fs_base/tree.c (working copy)
> @@ -1465,8 +1465,7 @@
> if (table)
> {
> apr_hash_index_t *hi;
> - apr_pool_t *subpool = svn_pool_create(pool);
> - for (hi = apr_hash_first(subpool, table); hi; hi = apr_hash_next(hi))
> + for (hi = apr_hash_first(NULL, table); hi; hi = apr_hash_next(hi))
> {
> svn_fs_dirent_t *entry;
> struct node_kind_args nk_args;
- application/pgp-signature attachment: stored
Received on Fri Oct 6 21:55:22 2006