Path: utzoo!attcan!uunet!lll-winken!sun-barr!cs.utexas.edu!samsung!crackers!m2c!umvlsi!dime!dime.cs.umass.edu!moss From: moss@cs.umass.edu (Eliot Moss) Newsgroups: comp.object Subject: Re: C++ and garbage collection Message-ID: Date: 19 Sep 90 21:19:51 GMT References: <1990Sep16.090226.11051@tukki.jyu.fi> <1990Sep18.131307.984@tukki.jyu.fi> <1990Sep19.114445.25042@tukki.jyu.fi> Sender: news@dime.cs.umass.edu Reply-To: moss@cs.umass.edu Organization: Dept of Comp and Info Sci, Univ of Mass (Amherst) Lines: 21 In-reply-to: sakkinen@tukki.jyu.fi's message of 19 Sep 90 11:44:45 GMT Modula-3 allows safe garbage collection, and it can be thought of as an extension to Pascal. The rule that M3 adds is that a variable must at all times contain a valid value of the variable's type. In general, this means that newly allocated pointers must be set to NIL before the program can see them. Appropriately sophisticated communication from the compiler to the run-time system (in the form of tables), plus good data-flow analysis based optimizations (e.g., dead store removal, etc.) will virtually eliminate any overhead this would incur, except for cases where the program fails to initialize items that appear to require initialization. This is exactly the approach we're taking in merging true garbage collection with heavy and sophisticated optimizations for Modula-3. I believe this can be done with any type safe language. Unfortunately, C and C++ are not type safe. -- J. Eliot B. Moss, Assistant Professor Department of Computer and Information Science Lederle Graduate Research Center University of Massachusetts Amherst, MA 01003 (413) 545-4206; Moss@cs.umass.edu