Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!wuarchive!udel!gatech!hubcap!billwolf%hazel.cs.clemson.edu From: billwolf%hazel.cs.clemson.edu@hubcap.clemson.edu (William Thomas Wolfe, 2847 ) Newsgroups: comp.sw.components Subject: Re: Re: Real-time Garbage Collection Message-ID: <6519@hubcap.clemson.edu> Date: 20 Sep 89 14:46:24 GMT References: <896@scaup.cl.cam.ac.uk> Sender: news@hubcap.clemson.edu Reply-To: billwolf%hazel.cs.clemson.edu@hubcap.clemson.edu Lines: 23 From scc@cl.cam.ac.uk (Stephen Crawley): >>>> It's safe to [reclaim a dynamicly allocated ADT]: >>>> 1) When the variable goes out of scope >>>> 2) When the programmer specifies that it's to be destroyed sooner. >> [...] 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. > > It makes no difference whether references to an ADT is implicit > or explicit. The ADT cannot know whether or not the application > that uses it still holds a reference to a given instance. The pointers are INTERNAL to the ADT, and the user will never see them. When the ADT goes out of scope, it dies just like any predefined type would. We are considering here an ADT which is declared at the beginning of a (procedure, function, block). This ADT will do dynamic allocation INTERNALLY so as to facilitate its own expansion and contraction as necessary. Upon block exit, the ADT's destroy procedure will be invoked, and all the space occupied by the ADT will be released. Bill Wolfe, wtwolfe@hubcap.clemson.edu