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