comp.lang.ada
 help / color / mirror / Atom feed
From: Matthew Heaney <matthew_heaney@acm.org>
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: <m3hftpf6je.fsf@mheaney.ni.net> (raw)
In-Reply-To: sYyo2.8309$Kg6.62453@news2.telusplanet.net

warwicks@telusplanet.net (Chris Warwick) writes:

> 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...

I don't know what you mean here.  Are you saying that the compilers
don't come with a garbage collector, or are you saying that when you
(manually) called an instantiation of unchecked_deallocation, the memory
didn't get deallocated?

Except for recent compilers that target the Java VM, no known Ada
compilers come with a garbage collector.

All known Ada compilers really do deallocate memory when you call
Unchecked_Deallocation.  

Please state whether you are refering to a manual invokation of
Unchecked_Deallocation, or to an automatic gargage collector; and, state
which specific compilers from which specific vendors you were using.

Perhaps this is a just a misunderstanding about what "deallocating
memory" means.

> >(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...

State the exact paper that was presented, and the email address of the
presenter.  I will speak to him to see if we can sort out his
difficulties.
 
> >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 came up,
> because the compiler I am using refuses to pass anything by value, and
> I am stuck with pointers passed through the interface code.

What convention are you using?  The language states what the passing
mechanism is for various types for language-defined conventions.

Perhaps if you post a small example of code that "refuses to pass
anything by value," we can analyze it to see if we can figure out what
the problem is.
-- 
Those who believe in the supernatural should be required to learn
computer programming.  This would force them to discover that things
which appear at first to be completely mysterious and incomprehensible,
in fact have a logical (and usually simple) explanation.  --J.B.R. Yant




  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 ` Tom Moran
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                   ` robert_dewar
1999-01-10  0:00                     ` Pat Rogers
1999-01-10  0:00                     ` Tom Moran
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       ` Stephen Leake
1999-01-08  0:00         ` Simon Wright
1999-01-07  0:00       ` robert_dewar
1999-01-09  0:00         ` Chris Warwick
1999-01-09  0:00           ` Brian Rogoff
1999-01-10  0:00             ` Matthew Heaney
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                 ` Simon Wright
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                 ` Matthew Heaney
1999-01-16  0:00                   ` robert_dewar
1999-01-18  0:00                   ` Chris Warwick
1999-01-18  0:00                     ` Matthew Heaney [this message]
1999-01-18  0:00                     ` dennison
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                           ` 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-19  0:00                           ` Stephen Leake
1999-01-06  0:00   ` Simon Wright
1999-01-22  0:00   ` Nick Roberts
replies disabled

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