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.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no 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!news2.google.com!postnews.google.com!t54g2000hsg.googlegroups.com!not-for-mail From: Maciej Sobczak Newsgroups: comp.lang.ada Subject: Re: memory management in Ada: tedious without GC? Date: Mon, 19 May 2008 01:35:42 -0700 (PDT) Organization: http://groups.google.com Message-ID: References: <4ddef8bf-b5b1-4d7e-b75b-386cd6c8402c@l17g2000pri.googlegroups.com> <9f2c2db4-d6c1-4cdf-884c-5cbc26ac7701@d1g2000hsg.googlegroups.com> NNTP-Posting-Host: 128.141.45.251 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: posting.google.com 1211186143 24529 127.0.0.1 (19 May 2008 08:35:43 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Mon, 19 May 2008 08:35:43 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: t54g2000hsg.googlegroups.com; posting-host=128.141.45.251; posting-account=bMuEOQoAAACUUr_ghL3RBIi5neBZ5w_S User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14,gzip(gfe),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:224 Date: 2008-05-19T01:35:42-07:00 List-Id: On 19 Maj, 05:50, Matthew Heaney wrote: > > In Ada RAII is realized with controlled types. They are severely > > broken in that they are intrusive in the type hierarchy and they burn > > the whole budget for implementation inheritance, > > No, this is wrong. You can add in Controlled-ness as far down the > hierarchy as you like, by adding a controlled component. Good to know. (But it is also good to know what Dmitry replied.) How would you use this strategy to make a controlled stream (derived from Root_Stream_Type)? > Furthermore, if you blow your budget in Ada, then you blow in C++ too, No. Adding a destructor in C++ does not blow any budget - it is independent of the hierarchy (and the hierarchy supports multiple inheritance anyway, so the budget is not constrained even if it would be used). -- Maciej Sobczak * www.msobczak.com * www.inspirel.com