From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=0.7 required=5.0 tests=BAYES_00,INVALID_DATE, MSGID_SHORT,REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 Path: utzoo!utgpu!watmath!clyde!att!rutgers!mailrus!uflorida!gatech!hubcap!billwolf From: billwolf@hubcap.clemson.edu (William Thomas Wolfe,2847,) Newsgroups: comp.lang.ada Subject: Re: Collective response to := messages Message-ID: <3772@hubcap.UUCP> Date: 6 Dec 88 20:43:34 GMT References: <812@quintus.UUCP> Sender: news@hubcap.UUCP Reply-To: billwolf@hubcap.clemson.edu List-Id: >From article <812@quintus.UUCP>, by ok@quintus.uucp (Richard A. O'Keefe): > In article <3740@hubcap.UUCP> billwolf@hubcap.clemson.edu writes: >>>From article <808@quintus.UUCP>, by ok@quintus.uucp (Richard A. O'Keefe): >>> It would be a service if you could elaborate on this [...] > >> The programmer is Johnny-on-the-spot. He/she KNOWS whether or not $> a given object is no longer needed. All that is necessary is an $> indication of this fact via the command DESTROY (Unneeded_Object). $ $ This simply isn't true. If I write a library routine which is passed $ some linked data structure, I may be able to tell whether my traversal $ of it has finished, but that leaves me with no idea whatsoever of $ whether I was given the last reference to it (in which case now is the $ time to delete it) or not. Whether or not the library routine should DESTROY its parameter depends on how the library routine is defined. How about a more specific example? # Or suppose some "object" has references to # some other objects, and I DESTROY(..) the first object. Should it # DESTROY(..) the other objects? In that case it may destroy things which # other objects still refer to! But if it doesn't, and it held the only # references to those objects, their space will not be reclaimed. Again, we need specifics here. I hope you aren't talking about structural sharing here, which should NEVER be seriously contemplated. % Is Johnny on the spot? NO! The programmer who coded the implementation % of that object has _no_idea_ how other programmers will use it. The implementor has no idea what *applications* the object will be used in, but has almost total control (the exceptions occur during parameter passing and block exit) over the operations of the ADT. & There _are_ garbage collection methods around where the overhead of & garbage collection is a constant times the cost of allocation. I specified O(n) with respect to the cost of each DEallocation, with the cost no higher than the overhead of doing the deallocation. This implies that the garbage collection routine has the ability to magically know the size and location of each and every piece of garbage, and has no need to examine any non-garbage.