[pypy-dev] pypy callback function pointer become invalid

Yicong Huang hengha.mao at gmail.com
Sun Aug 16 06:12:50 CEST 2015


Thanks for reminding!
I looked at the code, and observed the gloal new dict might leak memory.

Calling pypy_execute_source_ptr() multiple times might be a common usage:
you might have several python files to execute, or you might get python
code segment from input one by one ...
I am thinking could we have better ways to do such calls, e.g.:

pypy_initialize();
pypy_execute_source_ptr()
#call many times
...
#clean up
pypy_execute_end();
...
#to start a clean new session
pypy_initialize();
pypy_execute_source_ptr();
...
pypy_execute_end();



On Sun, Aug 16, 2015 at 12:24 AM, Maciej Fijalkowski <fijall at gmail.com>
wrote:

> On Sat, Aug 15, 2015 at 4:09 PM, Armin Rigo <arigo at tunes.org> wrote:
> > Hi Yicong,
> >
> > On 11 August 2015 at 14:38, Yicong Huang <hengha.mao at gmail.com> wrote:
> >>        pypy_execute_source_ptr(pyBuffer, &ptr);
> >
> > The documentation recommends to call pypy_execute_source_ptr() only
> > once.  I've fixed anyway the particular problem you are encountering
> > when calling it multiple times, in 20f74886a28e.
> >
> >
> > A bientôt,
> >
> > Armin.
>
> Note that if you execute it many many times, you will leak memory.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/pypy-dev/attachments/20150816/ecf7f758/attachment.html>


More information about the pypy-dev mailing list