[EMAIL PROTECTED] wrote:

Hi Tom,

> I'm developing a new cython class, and I currently have it print a message
> to tell me when it gets deallocated.
>
> When I instantiate the class in a function, __dealloc__ gets called -- but
> if I instantiate at the commandline and don't capture the reference, it's
> lost but doesn't get garbage collected.

It is a known issue that also happens if you create a matrix. I have no
real insight what goes wrong, so if you figure this out let is know.

> sage: I = memoryPhage() #eats all memory available
> sage: del I
> dealloc!
> sage: def foo():
> ...       memoryPhage()
> sage: foo()
> dealloc!
> sage: memoryPhage()
> sage: memoryPhage()
> ***crash and burn***

Do you check if the allocated memory is still valid, i.e. add a NULL check
before deallocating it? Can you post the code?

> This seems like a bad thing to me -- am I wrong?
>


:)

Cheers,

Michael

>
> >
>



--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-devel@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to