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,80bc3e0698be468f X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!news4.google.com!news.glorb.com!newsfeed.cw.net!cw.net!news-FFM2.ecrc.de!newsfeed.vmunix.org!peer-uk.news.demon.net!kibo.news.demon.net!news.demon.co.uk!demon!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: Type safety on wikipedia Date: Fri, 27 Jan 2006 19:38:47 +0000 Organization: Pushface Message-ID: References: <1138260496.230283.147640@g43g2000cwa.googlegroups.com> <1138283608.433842.76060@z14g2000cwz.googlegroups.com> <43D8E85C.6020805@mailinator.com> <1535741.yb0A0MsH1D@linux1.krischik.com> <43D912A3.2030201@mailinator.com> <43DA0061.1050501@mailinator.com> NNTP-Posting-Host: pogner.demon.co.uk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: news.demon.co.uk 1138390722 28695 62.49.19.209 (27 Jan 2006 19:38:42 GMT) X-Complaints-To: abuse@demon.net NNTP-Posting-Date: Fri, 27 Jan 2006 19:38:42 +0000 (UTC) Cancel-Lock: sha1:Qb2YCawvgQCkcFaA7OG9kcWQgV4= User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (darwin) Xref: g2news1.google.com comp.lang.ada:2687 Date: 2006-01-27T19:38:47+00:00 List-Id: "Alex R. Mosteo" writes: > Simon Wright wrote: >> "Alex R. Mosteo" writes: >> >>>This is something I've mused about sometimes: Let's suppose some Ada >>>compiler goes ahead and provides a GC. What happens with programs >>>written without taking this into account? >> 13.11.2(17) only says that Free _should_ reclaim the storage. I >> suppose for a GC implementation there could be at least 2 >> implementation strategies: >> * don't actually reclaim, just remove local reference and deal with >> tasks if necessary >> * check that the reference count is in fact 1 and raise *_Error if >> not! That would be useful! > > Neat! I hadn't figured that path of action. Indeed it seems a very > good strategy. I can imagine unknown bugs popping out after years of > silently wait and rare crashes... hehe... One point I had forgotten is that deallocation of a controlled object will finalize it -- LRM 13.11.2(9) -- so looking at it through a dangling pointer will be a Bad Thing even if GC has ensured that the mamory hasn't been re-used for something else.