Dan Sugalski wrote: > At 2:01 PM +0200 10/2/02, Leopold Toetsch wrote: > >> As already posted I incorparated the allocator from >> http://gee.cs.oswego.edu/dl/html/malloc.html >> in parrot. >> >> Some remarks: >> - it's totally stable now, runs all tests (parrot and perl6) >> - memory consumption is like CVS or much less ... >> - ... if resources.c is unpatched (#17702) >> - runs almost[1] everything in almost the same time > > > The license is fine for this, I'm not particularly wedded to any memory > allocator, and I think we might have sufficient restrictions in place to > make this feasable as a memory allocator.
Yep, and - if we don't need statistics (which libc might provide somewhere) a glibc based system runs out of the box, the Lea allocator is alreay there. > Since all pool memory has to be anchored with buffers, and allocation > has to use buffers, the GC issues get subsumed into DOD runs, which is > OK--memory allocation, reallocation, and freeing will all be actively > traceable so we shouldn't leak, at least if we don't leak buffers. Yes, this were my thoughts WRT GC > Could you, if you're feeling adventurous, rework resources.c and > memory.c to allow either the current scheme or the lea allocator? resources.c is not touched by my patch, it's replaced as a whole, which might be cleaner then some #ifdefs IMHO. memory.c is unchanged, though mem_sys_allocate ... could either be defines or go into platform specific code. So yes, there is dod.c, which differs by some lines, and string.c which is usable for both versions after my patch. I'll send a patch. > A > parrot compile-time switch is sufficient. (I realize much of the GC > system will just go away, and the DOD bits will be a little different) DOD is the same, there is only additional code for COWed strings in free_buffers. > It's work we should do anyway, as we're going to have to deal with > external allocators for embedded work, and if we work properly for lea, > we should work properly for that as well. Yes, when our interface is malloc/realloc/free, any allocator could be plugged in. leo