[sage-devel] Re: releasing memory in compiled components

2017-01-10 Thread kcrisman
On Monday, January 9, 2017 at 9:52:37 AM UTC-5, John Cremona wrote: > > In a reply to question 36225 at > https://ask.sagemath.org/question/36225/memory-leak-with-modular-symbols/ > (my reply was deleted by the system so you cannot read it) I offered > to try to help by asking here how to do s

Re: [sage-devel] Re: releasing memory in compiled components

2017-01-09 Thread Jeroen Demeyer
On 2017-01-09 23:11, Jean-Pierre Flori wrote: I guess that to do that you need an argless constructor which does not seem to be the case here. Does the C++ class not have an argless constructor or is it just not declared in the Cython file? -- You received this message because you are subscr

Re: [sage-devel] Re: releasing memory in compiled components

2017-01-09 Thread Jean-Pierre Flori
On Monday, January 9, 2017 at 10:33:49 PM UTC+1, Jeroen Demeyer wrote: > > On 2017-01-09 16:45, Jean-Pierre Flori wrote: > > I guess you want to free the memory allocated here: > > * > > > https://github.com/sagemath/sage/blob/master/src/sage/libs/eclib/newforms.pyx#L112 > > > Alternatively

Re: [sage-devel] Re: releasing memory in compiled components

2017-01-09 Thread Jeroen Demeyer
On 2017-01-09 16:45, Jean-Pierre Flori wrote: I guess you want to free the memory allocated here: * https://github.com/sagemath/sage/blob/master/src/sage/libs/eclib/newforms.pyx#L112 Alternatively, instead of a pointer you could store the object itself in the Python class. Then you wouldn't us

[sage-devel] Re: releasing memory in compiled components

2017-01-09 Thread Volker Braun
On Monday, January 9, 2017 at 9:08:46 PM UTC+1, Jean-Pierre Flori wrote: > > Isn't that the correct way to trigger Cytohn writin down an explicit call > to the destructor? > Right, every new'ed C++ object should be del'ed somewhere in the program. I misunderstood what you meant. -- You receiv

Re: [sage-devel] Re: releasing memory in compiled components

2017-01-09 Thread David Roe
On Mon, Jan 9, 2017 at 3:08 PM, Jean-Pierre Flori wrote: > > > On Monday, January 9, 2017 at 7:03:57 PM UTC+1, Volker Braun wrote: >> >> On Monday, January 9, 2017 at 4:45:19 PM UTC+1, Jean-Pierre Flori wrote: >>> >>> You can just use the Python "del" operator and Cython should translate >>> it t

[sage-devel] Re: releasing memory in compiled components

2017-01-09 Thread Jean-Pierre Flori
On Monday, January 9, 2017 at 7:03:57 PM UTC+1, Volker Braun wrote: > > On Monday, January 9, 2017 at 4:45:19 PM UTC+1, Jean-Pierre Flori wrote: >> >> You can just use the Python "del" operator and Cython should translate it >> to a destructor call. >> > > No, there is the following caveat when

[sage-devel] Re: releasing memory in compiled components

2017-01-09 Thread Volker Braun
On Monday, January 9, 2017 at 4:45:19 PM UTC+1, Jean-Pierre Flori wrote: > > You can just use the Python "del" operator and Cython should translate it > to a destructor call. > No, there is the following caveat when cyclic Python references are involved: __dealloc__ is always called, but there

[sage-devel] Re: releasing memory in compiled components

2017-01-09 Thread Jean-Pierre Flori
I guess you want to free the memory allocated here: * https://github.com/sagemath/sage/blob/master/src/sage/libs/eclib/newforms.pyx#L112 You should add a __dealloc__ method to your class and free the memory there: * http://docs.cython.org/en/latest/src/userguide/special_methods.html#finalization