On Aug 27, 11:24 pm, rjf <fate...@gmail.com> wrote: > perhaps ECL does not have something like schedule-finalization. I > think this is present in CMUCL, SBCL, Lispworks, and AllegroCL, at least.
ECL does have finalization but this is an overkill for the problem in question -- it would slow down all bignum arithmetics in the Common Lisp due to the additional resources that the garbage collector needs for tracking down finalizable objects. I have just uploaded some patches to our source repositories that allow ECL coexist with a GMP library which uses other memory allocation functions. The changes are available in the CVS and git repositories http://ecls.sf.net/download.html and will undergo automated testing during the following days. The changes are minimal, but I used the opportunity to do some code reorganization. Basically, as explained before, ECL will do the intermediate computations using GMP, but now the library will be allowed to use whatever memory allocation routines it wants. The output of these computations is then copied a Common Lisp bignum, using our own memory allocation routines, so that the data can be garbage collected. Intermediate values are cleared using mpz_clear() so that memory is reclaimed. In order to tell ECL that it should not overwrite GMP's allocation routines, there is a new option ECL_OPT_SET_GMP_MEMORY_FUNCTIONS, that can be set before calling cl_boot(). More precisely you should add the line ecl_set_option(ECL_OPT_SET_GMP_MEMORY_FUNCTIONS, 0); which tells ECL that it should not call mp_set_memory_functions(). I decided not to add any option to the autoconf files, since the change makes ECL more robust and it has little or no additional cost. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---