[pypy-dev] cffi dlopen

Roshan Cherian cherian.rosh at gmail.com
Tue Sep 22 19:37:47 CEST 2015


Thanks Armin. Yes __del__ fits my case and thanks for giving me so much
information.

Thanks,
-Roshan

On Tue, Sep 22, 2015 at 2:05 AM, Armin Rigo <arigo at tunes.org> wrote:

> Hi Roshan,
>
> On Mon, Sep 21, 2015 at 9:58 PM, Roshan Cherian <cherian.rosh at gmail.com>
> wrote:
> > I do have a question on memory management, currently I am using lib.
> > Currently lib provides me with icalcomponent_free which I pass in as the
> > function to be used in __del__. Should I be using this or should I be
> using
> > something specific from the python extension? This is what I see in the
> > python extension which was created.
> >
> > static void _cffi_d_icalcomponent_free(icalcomponent * x0)
> > (...)
>
> This is the code in C that implements the function
> "lib.icalcomponent_free()".  There are similar pieces of code for all
> other functions.  What are you asking specifically?  If it's ok to
> call such functions from a __del__()?  Yes, it is.
>
> Sometimes you can use ffi.gc() instead and give the function
> "lib.icalcomponent_free" directly as a second argument; then you don't
> need a __del__.  But if the __del__ solution suits your case, then
> that's fine.
>
>
> A bientôt,
>
> Armin.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/pypy-dev/attachments/20150922/50534da0/attachment.html>


More information about the pypy-dev mailing list