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

Re: svn commit: r1553822 - in /subversion/trunk/subversion/bindings/swig: include/svn_types.swg perl/libsvn_swig_perl/swigutil_pl.c perl/libsvn_swig_perl/swigutil_pl.h

From: Roderich Schupp <roderich.schupp_at_gmail.com>
Date: Sat, 28 Dec 2013 17:20:02 +0100

On Sat, Dec 28, 2013 at 4:35 PM, Bert Huijben <bert_at_qqmail.nl> wrote:

> While I assume this fixes a real problem... using the *global pool* is
> actually introducing a memory leak.

The "_global_pool" here is not global pool. In the Perl bindings, it's the
- somewhat unfortunate - name given to
to the C level variable in the generated wrapper for svn_foo(....,
apr_pool_t pool) that receives the Perl level
pool object. So it actually refers to whatever pool the caller of the
wrapped function passes.

If the caller passes undef on the Perl side - or simply leaves out the
trailing argument - it will
automagically use a truly global pool. That's probably where the name comes
from.

The commit actually plugs a memory leak: before the function always used an
explicit global pool
(in certain usecases), now it will use the one from the context, i.e. when
this conversion function
is called to convert a parameter of svn_foo(..., pool).

Cheers, Roderich
Received on 2013-12-28 17:20:42 CET

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