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,FREEMAIL_FROM, INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,86ec22e070e319c0 X-Google-Attributes: gid103376,public From: warwicks@telusplanet.net (Chris Warwick) Subject: Re: How do I get this to work?? Date: 1999/01/18 Message-ID: #1/1 X-Deja-AN: 433871383 References: <76s0dp$1v4$1@nntp3.uunet.ca> <76tbvv$ba5$1@nntp3.uunet.ca> <770ifd$qui$1@goblin.uunet.ca> <771bl9$sla$1@nnrp1.dejanews.com> <77b9cp$5kh$1@nnrp1.dejanews.com> X-Trace: news2.telusplanet.net 916634520 161.184.47.196 (Sun, 17 Jan 1999 21:42:00 MDT) Organization: gerf inc. NNTP-Posting-Date: Sun, 17 Jan 1999 21:42:00 MDT Newsgroups: comp.lang.ada Date: 1999-01-18T00:00:00+00:00 List-Id: In article , Matthew Heaney wrote: >Although officially all Unchecked_Conversion has to do is set the >pointer passed in to null, without actually deallocating any memory, in >practice UC really does reclaim memory. It's just like free(). So it >is untrue that "most Ada compilers have no way to deallocate memory." Of all the Ada compilers I have dealt with, both 83 and 95, none deallocate memory to my knowledge (GNAT may, but I haven't had need to look). Indeed this is one of the first questions I ask when I discover c++ programmers using Ada... >(Because the terms "heap" and "deallocate memory" aren't formally >specifiable, there's nothing the RM can do except specify external >behavior, as in "set the pointer to null.") At the last Tri-Ada I went to there was a discussion on how to fix this (95 allows you to define individual allocation strategies), but the gent who was trying had given up as it was too difficult... >The moral of the story is that, in general, when you have a choice, >don't manipulate references ("pointers") directly. The language >mandates the argument passing mechanism (by val vs by ref) for types >passed to a subprogram having a C convention, so the idea is to let the >compiler generate the reference ("address") automatically. I agree with this, but I am finding it difficult to use the Object features of Ada 95 without using pointers. This situation can up, because the compiler I am using refuses to pass anything by value, and I am stuck with pointers passed through the interface code.