On Sun, 15 Oct 2006 06:24:37 -0700, Martin Albrecht <[EMAIL PROTECTED]> wrote: > There will be a lot of places to change from Pymem and traditional >> malloc. >> One should go through the whole code base, change them all to use a >> macro >> like sage_malloc, then set that to omalloc, do "make test", and finally >> send me a patch. > > This will be a slow and painful process (but I'm willing to do it, it > might > take some time, however). Right now - if I only replace GMP's memory > functions SAGE segfaults all over the place. So I have to replace pretty > much > ever malloc/PyMem_Malloc (*) etc. with sage_malloc and hope that the > SEGFAULTs are not caused by a programming error in omalloc (which might > only > be triggered if it's built as a shared library so the Singular team > wouldn't > have noticed).
You should first replace everything with a sage_malloc, whilst keeping sage_malloc #defined to be "malloc". This won't be painful -- it'll be easy and has nothing to do with omalloc. Once you've done that you switch to omalloc and see what happens. > (*) e.g. a string generated my mpfr is freed using "free" right now. This > should be wrong even for PyMem_Malloc as MPFR builds on GMP and uses it's > memory functions IIRC? Yuck. Fixing these inconsistencies (which resulted from different authors), will be one of the big pluses of going through the code and using sage_malloc instead. William --~--~---------~--~----~------------~-------~--~----~ 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://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/ -~----------~----~----~----~------~----~------~--~---