comp.lang.ada
 help / color / mirror / Atom feed
From: warwicks@telusplanet.net (Chris Warwick)
Subject: Re: How do I get this to work??
Date: 1999/01/18
Date: 1999-01-18T00:00:00+00:00	[thread overview]
Message-ID: <sYyo2.8309$Kg6.62453@news2.telusplanet.net> (raw)
In-Reply-To: m3btjzipgf.fsf@mheaney.ni.net

In article <m3btjzipgf.fsf@mheaney.ni.net>, Matthew Heaney <matthew_heaney@acm.org> 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.




  parent reply	other threads:[~1999-01-18  0:00 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-01-04  0:00 How do I get this to work?? Chris Warwick
1999-01-05  0:00 ` Chris Warwick
1999-01-05  0:00   ` Stephen Leake
1999-01-05  0:00     ` Tom Moran
1999-01-06  0:00       ` robert_dewar
1999-01-06  0:00         ` Tom Moran
1999-01-07  0:00           ` robert_dewar
1999-01-07  0:00             ` Tom Moran
1999-01-10  0:00               ` robert_dewar
1999-01-10  0:00                 ` Tom Moran
1999-01-10  0:00                   ` robert_dewar
1999-01-10  0:00                     ` Pat Rogers
1999-01-10  0:00                     ` Tom Moran
1999-01-10  0:00                   ` robert_dewar
1999-01-06  0:00         ` Larry Kilgallen
1999-01-06  0:00           ` Tom Moran
1999-01-06  0:00         ` Tom Moran
1999-01-07  0:00           ` robert_dewar
1999-01-07  0:00             ` Tom Moran
1999-01-10  0:00               ` robert_dewar
1999-01-06  0:00     ` robert_dewar
1999-01-06  0:00     ` Chris Warwick
1999-01-06  0:00       ` Tom Moran
1999-01-07  0:00       ` robert_dewar
1999-01-09  0:00         ` Chris Warwick
1999-01-09  0:00           ` Simon Wright
1999-01-10  0:00             ` robert_dewar
1999-01-11  0:00               ` Simon Wright
1999-01-16  0:00               ` Chris Warwick
1999-01-16  0:00                 ` robert_dewar
1999-01-18  0:00                   ` Chris Warwick
1999-01-18  0:00                     ` Matthew Heaney
1999-01-16  0:00                 ` Simon Wright
1999-01-16  0:00                 ` Matthew Heaney
1999-01-16  0:00                   ` robert_dewar
1999-01-18  0:00                   ` Chris Warwick [this message]
1999-01-18  0:00                     ` Matthew Heaney
1999-01-18  0:00                     ` robert_dewar
1999-01-18  0:00                       ` dennison
1999-01-18  0:00                       ` Tucker Taft
1999-01-19  0:00                         ` Chris Warwick
1999-01-19  0:00                           ` Tom Moran
1999-01-19  0:00                           ` Stephen Leake
1999-01-19  0:00                           ` robert_dewar
1999-01-20  0:00                             ` Jeff Carter
1999-01-20  0:00                               ` robert_dewar
1999-01-21  0:00                                 ` Chris Warwick
1999-01-18  0:00                     ` dennison
1999-01-09  0:00           ` Brian Rogoff
1999-01-10  0:00             ` Matthew Heaney
1999-01-07  0:00       ` Stephen Leake
1999-01-08  0:00         ` Simon Wright
1999-01-06  0:00   ` Simon Wright
1999-01-22  0:00   ` Nick Roberts
1999-01-05  0:00 ` Tom Moran
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox