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!news3.google.com!news.glorb.com!newsfeed.utanet.at!newsfeed.inode.at!news.hispeed.ch!linux2.krischik.com!news From: Martin Krischik Newsgroups: comp.lang.ada Subject: Re: Type safety on wikipedia Date: Thu, 26 Jan 2006 17:49:01 +0100 Organization: Cablecom Newsserver Message-ID: <1535741.yb0A0MsH1D@linux1.krischik.com> References: <1138260496.230283.147640@g43g2000cwa.googlegroups.com> <1138283608.433842.76060@z14g2000cwz.googlegroups.com> <43D8E85C.6020805@mailinator.com> NNTP-Posting-Host: 84-74-134-212.dclient.hispeed.ch Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit X-Trace: news.hispeed.ch 1138294803 25382 84.74.134.212 (26 Jan 2006 17:00:03 GMT) X-Complaints-To: news@hispeed.ch NNTP-Posting-Date: Thu, 26 Jan 2006 17:00:03 +0000 (UTC) User-Agent: KNode/0.10 Xref: g2news1.google.com comp.lang.ada:2650 Date: 2006-01-26T17:49:01+01:00 List-Id: Alex R. Mosteo wrote: > jimmaureenrogers@worldnet.att.net wrote: > >> I do not see how Unchecked_Deallocation interferes with type safety. >> Ada access types are typed. There is no Ada equivalent to a C void*. An >> Ada access type cannot be made to point to an object of some foreign >> type. For instance, >> >> type Integer_Access is access Integer; >> >> An instance of Integer_Access cannot reference a task, or a real >> number, or some record type. Garbage collection cannot improve type >> safety in Ada or any other language. It can only automate the process >> of deallocating dynamically allocated objects. > > Well, the argument given in the discussion is like this: you allocate a > pointer, make some aliases and free one of them. Further allocations > (presumibly unrelated) reuse the same heap area. You can now use a > dangling pointer not correctly deallocated pointing to a valid memory > area within the program, but holding completely unrelated data (from > other types, probably). > > Obviously, in a GCed language, no memory area can be reallocated as long > as any reference to it is still alive. > > There's a glaring affirmation in the article (not discussion) saying > that Ada is type safe, with ML. So I wonder. It's a Wiki and there is a dispute warning on top of it. I wonder if the Ada link need to be removed! And perhaps a chapter on almost type save languages could be added where Ada would more better placed. But then Ada is supposed to me GC - only the vendors are to lazy to add an collector. As said: It made me think. Martin -- mailto://krischik@users.sourceforge.net Ada programming at: http://ada.krischik.com