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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,147f221051e5a63d X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!feeder1-2.proxad.net!proxad.net!feeder1-1.proxad.net!club-internet.fr!feedme-small.clubint.net!nuzba.szn.dk!news.jacob-sparre.dk!pnx.dk!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: memory management in Ada: tedious without GC? Date: Fri, 23 May 2008 19:45:17 -0500 Organization: Jacob's private Usenet server Message-ID: References: <4ddef8bf-b5b1-4d7e-b75b-386cd6c8402c@l17g2000pri.googlegroups.com> <9f2c2db4-d6c1-4cdf-884c-5cbc26ac7701@d1g2000hsg.googlegroups.com> <1qxcw3pphdlek.1jgsfwb7atdmo.dlg@40tude.net> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: jacob-sparre.dk 1211589930 31113 69.95.181.76 (24 May 2008 00:45:30 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Sat, 24 May 2008 00:45:30 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5512 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5512 Xref: g2news1.google.com comp.lang.ada:313 Date: 2008-05-23T19:45:17-05:00 List-Id: "Robert A Duff" wrote in message news:wccskw8d332.fsf@shell01.TheWorld.com... > "Dmitry A. Kazakov" writes: ... >> Well, I suggest that the overhead required in C++ for maintenance virtual >> destructors should be lower than one Ada.Finalization. For example it >> does >> not require linked list of objects. > > Ada's finalization does not require a linked list for stack-allocated > objects. It does for heap-allocated ones. More importantly, why would you care? If the two words of overhead per object is too much, then surely the overhead of a tag is too much as well (also two words per object) and you'll have to regress to an untagged type. Similarly for the runtime cost (two instructions per object). Moreover, the heroic efforts needed to deal with finalization of abandoned objects in any language with exceptions (which includes both Ada and C++) is going to cost as much or more (surely in code size, and probably in execution, too) as any linked list solution. Randy.