Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!elroy.jpl.nasa.gov!decwrl!pa.dec.com!src.dec.com!src.dec.com!muller From: muller@src.dec.com (Eric Muller) Newsgroups: comp.lang.modula3 Subject: Re: garbage collection and fast allocation/deallocation Message-ID: <1991Jun5.104518.8547@src.dec.com> Date: 5 Jun 91 17:45:18 GMT References: <9106051432.AA22607@riposte> Sender: news@src.dec.com (News) Reply-To: muller@src.dec.com (Eric Muller) Organization: DEC Systems Research Center Lines: 21 In article <9106051432.AA22607@riposte>, wyant@saber.com ask about specialized allocators and deallocators. The Modula-3 language does not offer direct support for that. However, in SRC Modula-3, the runtime is written in Modula-3 and we give the source. In particular, the interfaces RTHeap and RTHeapRep, and the module RTHeap that implements them, are concerned with traced heap management. There is nothing that prevents a program from using an alternative implementation of RTHeap. This implementation could treat the allocation requests differently based on the typecode of the referent to allocate. It could also receive hints from the program, also based on typecodes. It is also conceivable to use the current system for some typecodes, and another one for other typecodes. The current collector would not support very well 'free' methods, as detecting the deallocated objects would imply a sweep of the heap. -- Eric.