Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cwjcc!gatech!prism!tynor From: tynor@prism.gatech.EDU (Steve Tynor) Newsgroups: comp.sw.components Subject: Re: Real-time Garbage Collection Message-ID: <1917@hydra.gatech.EDU> Date: 19 Sep 89 13:48:23 GMT References: <6497@hubcap.clemson.edu> Reply-To: tynor@prism.gatech.EDU (Steve Tynor) Organization: Georgia Institute of Technology Lines: 33 In article <6497@hubcap.clemson.edu> billwolf%hazel.cs.clemson.edu@hubcap.clemson.edu writes: >From rang@cs.wisc.edu (Anton Rang): >>> It's safe to do so: >>> 1) When the variable goes out of scope >>> 2) When the programmer specifies that it's to be destroyed sooner. >> >> If there's any explicit pointer manipulation, these conditions >> aren't sufficient, because an object can be pointed to in more than >> one place. > > True, but the basic thrust of the position is that the programmer > should generally not use pointers explicitly; rather, the use of > pointers should be made safe via encapsulation within a secure ADT. Whether a reference to a shared object is a pointer, or is hidden via some clever encapsulation, I can't see how the programmer can be expected to know when to explicitly deallocate the reference without maintaining reference counts (whether he does it, or the ADT - it's still reference counting) or relying on GC (or assuming that references are _never_ shared - which seems like a simplistic assumption). I am (as we speak) trying to implement a ADT (in Ada) which contains objects whose lifetimes are not lexically scoped and to which many other objects may refer. I'd be very happy to avoid reference counts and GC if someone can suggest a way to do so! =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= WITH disclaimer; USE disclaimer; Steve Tynor Georgia Tech Research Institute Artificial Intelligence Branch tynor@prism.gatech.edu