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

Re: svn commit: rev 1186 - trunk/subversion/bindings/ruby

From: Greg Stein <gstein_at_lyra.org>
Date: 2002-02-06 03:46:51 CET

On Wed, Feb 06, 2002 at 11:16:10AM +0900, Yoshiki Hayashi wrote:
> Greg Stein <gstein@lyra.org> writes:
>
> > That isn't quite correct. svn_fs_close_fs() only clears/destroys a subpool.
> > It will /not/ affect the pool that you passed in when you created the FS
> > object. It is perfectly safe to call close_fs().
> >
> > > svn_repos_fs returns svn_fs_t * which lives in the same pool
> > > of svn_repos_t *.
> >
> > No... the FS lives in a subpool. That subpool can be independently freed.
>
> Ah, then this is the bug in svn_repos_open?

What bug? Just what exactly are you seeing?

> libsvn_repos/repos.c:
>
> svn_error_t *
> svn_repos_open (svn_repos_t **repos_p,
> const char *path,
> apr_pool_t *pool)
> {
> apr_status_t apr_err;
> svn_repos_t *repos;
>
> /* Allocate a repository object. */
> repos = apr_pcalloc (pool, sizeof (*repos));
> repos->pool = pool;
>
> /* Initialize the repository paths. */
> repos->path = apr_pstrdup (pool, path);
> init_repos_dirs (repos, pool);
>
> /* Initialize the filesystem object. */
> repos->fs = svn_fs_new (pool);

This says to create repos->fs in 'pool'. The FS does so, as a child pool.
When you call close_fs(), it destroys the *child* pool. It doesn't touch
'pool' at all.

Therefore, closing the fs isn't going to affect the repos object.

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Oct 21 14:37:04 2006

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

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.