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=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,a77baf86c187076a X-Google-Attributes: gid103376,public From: "W. Wesley Groleau (Wes)" Subject: Re: Garbage collection (was a spinoff of a spinoff of a GA Date: 1996/10/21 Message-ID: <9610211427.AA06636@most>#1/1 X-Deja-AN: 191142888 sender: Ada programming language comments: Gated by NETNEWS@AUVM.AMERICAN.EDU mailer: Elm [revision: 70.85] newsgroups: comp.lang.ada Date: 1996-10-21T00:00:00+00:00 List-Id: It looks like Jon Anthony attempted to answer my question in a post that never got to me. And if you were to believe Alta Vista you'd think neither Jon nor I ever posted on the subject! But I DID see Jon's > Second, none of this [finalization] stuff covers all the cases. .... > doesn't. And, even if it were to work for the particulars of a > specific application, you still have to go and roll your own stuff and > make sure it is all correct and whatnot. None of this is particularly > incomprehensible. Let me put my question another way: What are the pros and cons of the following three choices? Choice One (in the spec): Declare a data type. Put a comment on it saying -- Make sure you put calls to the cleanup routines in in every place -- where an object of this type might leave scope. Make sure you -- put an exception handler in every routine that declares one of these, -- or else ensure that no exception can occur. And better guarantee that -- exceptions cannot occur in declarative regions. Choice Two (in the spec): -- If you intend to use this data type, you had better ensure that your -- compiler has a good garbage collector, or get an add-on that can -- work with your compiler's allocation methods. Choice Three (in the BODY): procedure Finalization (...) is -- this will ensure that cleanup cannot be forgotten. What are the cases Finalization doesn't cover? (Other than those the programmer DECIDED not to apply it to.) And what is so hard about "roll your own"? After all this argument about how and why this and that type of collector can bite you on the behind, how can anyone complain that begin Free (Param); end Finalization; is so difficult. Sure, the compiler might fail to call it, but we have better ways of dealing with naughty compilers than adding on outside tools of arguable value. --------------------------------------------------------------------------- W. Wesley Groleau (Wes) Office: 219-429-4923 Hughes Defense Communications (MS 10-40) Home: 219-471-7206 Fort Wayne, IN 46808 (Unix): wwgrol@pseserv3.fw.hac.com ---------------------------------------------------------------------------