[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: Yoshiki Hayashi <yoshiki_at_xemacs.org>
Date: 2002-02-06 05:20:10 CET

Greg Stein <gstein@lyra.org> writes:

> > 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.

Ahh, thanks (it also goes to Kerl). I stand corrected. (My
brain is not functioning well because I had to wake up early
in the morning to supervise a term end exam of
undergraduate. Funny that I was taking the exam of graduate
course by the same teacher yesterday...)

The commit actually fixed pool usage bug in Svn::Repos#fs
but probably it was a wrong fix. Having parent and child
relationship of pool in different objects is a hairy issue.
You cannot simply destroy parent's pool from finalization
when parent object is garbage collected because there may be
some objects allocated from subpool. All other Svn::Fs*
objects have the same problem. It has been on my TODO list
for quite some time to fix but perhaps now is the good time
to fix them all. I'll investigate it.

-- 
Yoshiki Hayashi
---------------------------------------------------------------------
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.