Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!uunet!microsoft!jimad From: jimad@microsoft.UUCP (Jim ADCOCK) Newsgroups: comp.object Subject: Re: C++ and garbage collection (Was: Re: What is Objective C?) Message-ID: <57523@microsoft.UUCP> Date: 18 Sep 90 17:50:14 GMT References: <1990Sep12.074154.657@tukki.jyu.fi> <1990Sep16.090226.11051@tukki.jyu.fi> Reply-To: jimad@microsoft.UUCP (Jim ADCOCK) Organization: Microsoft Corp., Redmond WA Lines: 36 In article pcg@cs.aber.ac.uk (Piercarlo Grandi) writes: >Also, there is no degree of conservativeness in a storage reclaimer -- >either it is conservative, and it will consider as a pointer any word >whose numeric value can be interpreted as an address into the heap, or >it is not conservative, and it *knows* which words are pointers. While this statement is probably only intended as a definition: "A reclaimer is conservative if it always assumes any numerical value could be a pointer to [into] an object to be retained" -- in practice things are not so black and white. You can have hybrid systems where some locations are known to be or not be pointers, and other words may or may not be pointers, requiring a conservative approach to those pointers only. You can have systems where the requirement is that interior pointers "don't count" towards keeping an object alive, or where they do. You can have systems where referred-to objects must be quad-aligned to be kept alive -- objects on two-byte alignment don't count. You can have systems where objects must be allocated in known pools to count. Or where the references have to be kept in pools. You can have systems where the reference must be quad-aligned to count -- pointers on two-byte alignment doesn't count. etc. Seems to me for any GC system to work, there are a set of rules on fair usage of objects and references that must be obeyed. "Conservative" systems [in whatever shade on black, white or grey] are no different in that regard. Successful GC systems will have a set of rules that are not onerous for programmers to obey, either in complexity of programming, nor in the execution speed or size of the resulting code.