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 <ar...@tunes.org> wrote: > Hi Roshan, > > On Mon, Sep 21, 2015 at 9:58 PM, Roshan Cherian <cherian.r...@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. >
_______________________________________________ pypy-dev mailing list pypy-dev@python.org https://mail.python.org/mailman/listinfo/pypy-dev