On Aug 25, 10:33 am, Martin Albrecht <m...@informatik.uni-bremen.de>
wrote:
> Excuse my ignorance, I am sure this was answered a long time ago but I can't
> find it right now: why don't you just steal the memory manager back from GMP,
> i.e. why does ECL require the GMP memory manager to use its garbage collected
> memory?

Yes, this did come up. ECL doesn't do reference counting. If a bignum
becomes unreachable, it gets collected by Boehm-Weiser, but mpz_clear
() is not called on the mpz_t part. ECL relies on the limbs being
allocated by Boehm-Weiser, so that they are reclaimed once they become
unreachable.  So if we just change the memory manager back, ECL will
be creating all kinds of "mpz_t"s without freeing them and hence
create a memory leak.

ECL does have a "finalize" option, which allows a finalizer to be
connected to an object. If we were to change ECL so that every bignum
gets a finalizer that calls mpz_clear(), we could change the memory
manager back. I have no idea how to do that, though.

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

Reply via email to