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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,ed6a891101ff4e06 X-Google-Attributes: gid103376,public From: dewarr@my-dejanews.com Subject: Re: Freeing Pointers to classwide types Date: 1998/10/01 Message-ID: <6v06o6$n4i$1@nnrp1.dejanews.com>#1/1 X-Deja-AN: 396703600 References: <1ftmFTC69GA.191@samson.airnet.net> <360b26a1.41575272@SantaClara01.news.InterNex.Net> <6ugeu2$79u$1@nnrp1.dejanews.com> <360c4a70.29707515@SantaClara01.news.InterNex.Net> <6uifpt$e98$1@nnrp1.dejanews.com> <360d1380.165146@SantaClara01.news.InterNex.Net> <6ulj29$ne3$1@nnrp1.dejanews.com> <360e790d.241368@SantaClara01.news.InterNex.Net> <6umkl8$qbm$1@nnrp1.dejanews.com> <360f143c.39974468@SantaClara01.news.InterNex.Net> <6uo8mt$el9$1@nnrp1.dejanews.com> <360fc072.1728326@SantaClara01.news.InterNex.Net> <6uokru$lbi$1@uuneo.neosoft.com> <360fec6e.12989714@SantaClara01.news.InterNex.Net> <6upond$4lc$1@nnrp1.dejanews.com> <361126ef.4269711@SantaClara01.news.InterNex.Net> <36127a1c.276097@SantaClara01.news.InterNex.Net> <6uuo50$1pg$1@nnrp1.dejanews.com> <36131a1b.34896409@SantaClara01.news.InterNex.Net> X-Http-Proxy: 1.0 x13.dejanews.com:80 (Squid/1.1.22) for client 205.232.38.14 Organization: Deja News - The Leader in Internet Discussion X-Article-Creation-Date: Thu Oct 01 15:22:46 1998 GMT Newsgroups: comp.lang.ada X-Http-User-Agent: Mozilla/2.02 (OS/2; I) Date: 1998-10-01T00:00:00+00:00 List-Id: In article <36131a1b.34896409@SantaClara01.news.InterNex.Net>, tmoran@bix.com (Tom Moran) wrote: > >But it is a trivial excercise to rewrite this so that it uses an Ada > >allocator > Without using Unchecked_Conversion and Unchecked_Deallocation? And why on earth would you try to avoid these? You can write perfectly portable code using these routines if you know what you are doing. It is particularly odd to complain about the use of Unchecked_Deallocation in a routine devoted to storage allocation and deallocation, and there is nothing at all non-portable about the kind of use of UD you would use here. As for UC, sure you have to be careful how you use it, and from a formal point of view, it is probably true that the RM will not guarantee that what you would write would work, but that should not deter you from writing perfectly portable code (in practice) using UC. It is always surprising when people are absolutely set against UC, and the result is that people write code in C that is exactly equivalent. I remember one comparison of Ada vs C presentation I saw for an AI application. The C was much faster. Virtually 100% of the difference was in allocation. I asked what was going on "Do you use malloc?" "Oh no, that's far too slow, we wrote our own allocator in C" "Well why didn't you do the same in Ada" "Because it wouldn't have been portable" "But your C is not portable in a formal sense anyway" "Well it works on three different machines!!!" Sigh! Ada folks are good at shooting themselves in the foot, and it isn't even the language that's doing it :-) -----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own