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,92748798eb3c95c4 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!news.glorb.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local1.nntp.dca.giganews.com!nntp.megapath.net!news.megapath.net.POSTED!not-for-mail NNTP-Posting-Date: Tue, 24 Aug 2004 13:34:43 -0500 From: "Randy Brukardt" Newsgroups: comp.lang.ada References: <87oel1j70l.fsf@deneb.enyo.de> Subject: Re: Ada has garbage collection Date: Tue, 24 Aug 2004 13:35:38 -0500 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4807.1700 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300 Message-ID: NNTP-Posting-Host: 64.32.209.38 X-Trace: sv3-osS3WPYCIrh/Y2kx8XGtlyBEevmRZa9JSNVj8NxNnpp6M1qy+zncsiJzWwyBtH0amfT2rvwzCLnSr0X!2svyvD7rHVu3A0HtEGYASEcZDgtcoGKtdgJ62OA/xsTzZsTa5john8dVO3Rgn8a4uovaMTX8Tcod X-Complaints-To: abuse@megapath.net X-DMCA-Complaints-To: abuse@megapath.net X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.13 Xref: g2news1.google.com comp.lang.ada:2967 Date: 2004-08-24T13:35:38-05:00 List-Id: "Florian Weimer" wrote in message news:87oel1j70l.fsf@deneb.enyo.de... > * Wes Groleau: ... > > Of course, some problems/data structures almost demand > > pointers, but with sensible encapsulation and package > > designed, controlled types provide all the GC those things need. > > Of course you can implement an ownership policy manually (or some > simple form of garbage collection like reference counting, especially > if your data structures aren't cyclic). This is a tedious task, and > if you implement the wrong ownership policy, you often prevent code > reuse. It's quite a bit of work to make something completely safe > against misuse. Designing for reuse is hard, period. And expecting to reuse things without that is folly. And, if you're designed for reuse, you *have to* make it safe against misuse. Claw does a lot of things that aren't strictly necessary in order to eliminate or mitigate misuse. One example is that all of the entry calls into the message task are timed entry calls; an exception is raised if they aren't accepted in a reasonable time. That's done to prevent deadlock which can occur when an operation is called during the rendezvous of a handler. > Memory management errors are hard to debug. True, but not if they aren't made in the first place. :-) The last two memory leaks I had to debug turned out to be compiler errors -- the software was correct, the compiler wasn't implementing it properly. And those were the only ones in the last year. Note that any sort of memory recovery is wasted effort in quick running programs; Janus/Ada only tries to recover memory that could be reused during a compilation (a very small proportion of the memory allocated); the completion of a compilation pass ends all use of memory without any overhead at all. Randy.