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

RE: [PATCH, test] modify libsvn_wc to use result_pool/scratch_pool

From: Bert Huijben <rhuijben_at_sharpsvn.net>
Date: Sun, 16 Aug 2009 18:55:00 +0200

> -----Original Message-----
> From: Stefan Sperling [mailto:stsp_at_elego.de]
> Sent: zondag 16 augustus 2009 16:28
> To: Martin Hauner
> Cc: dev_at_subversion.tigris.org; Greg Stein
> Subject: Re: [PATCH, test] modify libsvn_wc to use
> result_pool/scratch_pool
>
> >
> > if (kind != svn_node_none && kind != svn_node_dir)
> > {
> > @@ -56,12 +57,12 @@
> > Might happen if there's a file in the way, for example. */
> > return svn_error_createf(APR_ENOTDIR, NULL,
> > _("'%s' is not a directory"),
> > - svn_dirent_local_style(path, pool));
> > + svn_dirent_local_style(path,
> scratch_pool));
>
> I'm not really sure about this one. You are returning an error,
> and which pool to use depends on the caller's behaviour.
>
> Maybe there is a convention for this, I'm not sure. Greg?

svn_error_createf() copies all arguments to a pool for the error message, so
you can just use the scratch pool here. (Each error chain has its own
apr_pool, which is destroyed by clearing the error).

        Bert

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2384087
Received on 2009-08-16 18:55:33 CEST

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