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,start X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!l17g2000pri.googlegroups.com!not-for-mail From: "jhc0033@gmail.com" Newsgroups: comp.lang.ada Subject: memory management in Ada: tedious without GC? Date: Fri, 16 May 2008 10:44:11 -0700 (PDT) Organization: http://groups.google.com Message-ID: <4ddef8bf-b5b1-4d7e-b75b-386cd6c8402c@l17g2000pri.googlegroups.com> NNTP-Posting-Host: 75.18.114.21 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: posting.google.com 1210959851 32160 127.0.0.1 (16 May 2008 17:44:11 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 16 May 2008 17:44:11 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: l17g2000pri.googlegroups.com; posting-host=75.18.114.21; posting-account=ZDEUcwoAAAAfEl68GET6fODebgE-CIe2 User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; 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:109 Date: 2008-05-16T10:44:11-07:00 List-Id: I'm mostly soliciting answers from Ada programmers who know C++ RAII well (Skip this if you use the words "C" and "C++" interchangeably, please. Your answers will be misleading at best): As I understood from reading the Memory Management section of Wikibooks on Ada, Ada's memory management facilities are roughly equivalent to a. C++-like "new" b. C++-like "delete" c. Java-like "finally" d. your implementation may or may not have GC Did I misunderstand? To me, this seems much, much more error-prone and tedious that C++'s RAII approach, where you almost never have to worry about deallocation (i.e. "b" and "c" above), even in the presence of exceptions, unless you have GC. Besides, RAII applies to a bunch of other things, like thread locks, database connections, files - not just memory.