[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [PATCH] libsvn_client: Avoid direct call tosvn_pool_create()function

From: Bhuvaneswaran Arumugam <bhuvan_at_collab.net>
Date: 2007-01-10 11:38:36 CET

On Tue, 2007-01-09 at 11:12 -0800, Daniel Rall wrote:
> On Tue, 09 Jan 2007, Bhuvaneswaran Arumugam wrote:
>
> > Hello,
> >
> > Please find attached the patch.
>
> It would be useful to have a description of why your patches are
> necessary (e.g. what's the problem you're trying to solve)?

Thanks for your comment Dan. Here, since I explain the description of
this patch as part of the commit message, i avoided mentioning the same
here.

> > [[[
> > Avoid calling svn_pool_create() function directly for passing the return
> > value as an argument.
> >
> > * subversion/libsvn_client/prop_commands.c
> > (svn_client_proplist2): Avoid calling svn_pool_create() function
> > directly for passing the return value as an argument for
> > remote_proplist() function.
> >
> > Patch by: bhuvan
> > Reviewed by: kameshj
> > ]]]
>
> Index: subversion/libsvn_client/prop_commands.c
> ===================================================================
> --- subversion/libsvn_client/prop_commands.c (revision 22939)
> +++ subversion/libsvn_client/prop_commands.c (working copy)
> @@ -1110,9 +1110,11 @@
>
> SVN_ERR(svn_ra_check_path(ra_session, "", revnum, &kind, pool));
>
> + apr_pool_t *scratchpool = svn_pool_create(pool);
> SVN_ERR(remote_proplist(*props, url, "",
> kind, revnum, ra_session,
> - recurse, pool, svn_pool_create(pool)));
> + recurse, pool, scratchpool));
> + svn_pool_destroy(scratchpool);
> }
> else /* working copy path */
> {
>
>
> IIUC, we typically call the local variable "subpool". More
> importantly, you can't declare a variable at that point -- its
> declaration needs to come earlier (though it's definition is probably
> best where yo uhave it).

You are right. But in this case, the value is passed as an argument for
the function remote_proplist() and a subpool is created from this pool.
So, i think, that's the reason for naming this variable as scratchpool.

I've incorporated your suggestion and attached the revised patch. Please
review it. Thank you.

-- 
Regards,
Bhuvaneswaran

Received on Wed Jan 10 11:38:49 2007

This is an archived mail posted to the Subversion Dev mailing list.