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.8 required=5.0 tests=BAYES_00,INVALID_DATE autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1014db,8e3b3db66f3b0061 X-Google-Attributes: gid1014db,public X-Google-Thread: 109fba,8e3b3db66f3b0061 X-Google-Attributes: gid109fba,public X-Google-Thread: f4fd2,8e3b3db66f3b0061 X-Google-Attributes: gidf4fd2,public X-Google-Thread: 103376,474d28ddf953b3c1 X-Google-Attributes: gid103376,public X-Google-Thread: fd443,8e3b3db66f3b0061 X-Google-Attributes: gidfd443,public X-Google-ArrivalTime: 1994-12-10 13:28:20 PST Newsgroups: alt.lang.design,comp.lang.c,comp.lang.c++,comp.lang.lisp,comp.lang.ada Path: nntp.gmd.de!newsserver.jvnc.net!news.cac.psu.edu!news.pop.psu.edu!psuvax1!news.ecn.bgu.edu!news.cts.eiu.edu!vixen.cso.uiuc.edu!uwm.edu!lll-winken.llnl.gov!noc.near.net!inmet!dsd!bobduff From: bobduff@dsd.camb.inmet.com (Bob Duff) Subject: Re: Reference Counting (was Re: Searching Method for Incremental Garbage Collection) Message-ID: Sender: news@inmet.camb.inmet.com Organization: Intermetrics, Inc. References: <3bii2g$kn2@news.parc.xerox.com> <3bjfep$9ss@gamma.ois.com> <3bo43b$61v@news.parc.xerox.com> Date: Fri, 9 Dec 1994 22:07:25 GMT Xref: nntp.gmd.de comp.lang.c:71605 comp.lang.c++:82250 comp.lang.lisp:9516 comp.lang.ada:17382 Date: 1994-12-09T22:07:25+00:00 List-Id: In article , Henry G. Baker wrote: >I just wanted to point out again that objects whose reference counts >are always one, and the programmer/compiler knows this, avoid the >usual overheads of reference counting. But it seems to me that in a language like Ada, if a given object only has one reference pointing to it, and that fact is known at compile time, then you would almost always declare that object as a normal stack-allocated object. So it would not be in the heap in the first place, so reference counting would never occur. In other words, the optimization you mention seems useful in a language like Lisp, where everything's a pointer, but it seems irrelevant to Ada. Or, to put it differently, Ada compiler's already do this optimization -- the way you invoke it is to use an object instead of a pointer-to-object. - Bob P.S. I've read quite a few of Henry's papers. They really are quite entertaining (especially the titles) and informative. -- Bob Duff bobduff@inmet.com Oak Tree Software, Inc. Ada 9X Mapping/Revision Team (Intermetrics, Inc.)