comp.lang.ada
 help / color / mirror / Atom feed
From: dewar@merv.cs.nyu.edu (Robert Dewar)
Subject: Re: Flexible Strings (was Equality operator...)
Date: 1997/05/10
Date: 1997-05-10T00:00:00+00:00	[thread overview]
Message-ID: <dewar.863287346@merv> (raw)
In-Reply-To: lvzpu4gvt7.fsf@sulu.fl.ensco.com


Erik said

<<Robert, your claim is a little broad here. I have used 2 different Ada 83
compilers runtimes for embedded targets that did NOT implement any storage
reclamation for Unchecked_Conversion, i.e., UC simply set the pointer to
null. (One of these was the small runtime from a company you used to work
with!) Now, both of these compilers also had versions that supported
reclaiming storage. But for small, embedded systems, it is often nice to
have a simple "new" that you can use at startup without including any
overhead for UC. If you believe that these compilers were useless, you had
better not fly on any modern commercial airliner.>>

(finally I see your original post, rather than a quote of a piece of it)

It is DEFINITIELY appropriate for an Ada 83 compiler to offer a choice
of storage allocators in this manner. Actually it is interesting to note
that from what you say, they DID provide unchecked deallocation that worked
via an option.

In fact I can imagine an Ada 83 compiler for an embedded system which
simply completely ignored UC under all circumstances, and as you rightly
point out, this is often an appropriate choice for small embedded
systems. Actually what you really want in this case is not a UC that
does nothing at runtime, you want to declare access types for which UD
(oops UC => UD throughout, I'm copying your mistake :-) is simply not
permitted, period.

Note that in Ada 95, providing you are using a compiler, such as GNAT, that
fully supports annex H, then you have *exactly* what you need via

   pragma Restrictions (No_Unchecked_Deallocation);

this will cause a program to be illegal if it attempts to instantiate
Unchecked_Deallocation -- just what you want for your small embedded system
example.





  reply	other threads:[~1997-05-10  0:00 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-04-30  0:00 Flexible Strings (was Equality operator...) W. Wesley Groleau (Wes)
1997-04-30  0:00 ` Matthew Heaney
1997-05-01  0:00   ` Robert Dewar
1997-05-02  0:00   ` Kevin Cline
1997-05-03  0:00     ` Robert Dewar
1997-05-04  0:00       ` Kevin Cline
1997-05-04  0:00         ` Robert Dewar
1997-05-06  0:00           ` Kaz Kylheku
1997-05-07  0:00             ` Robert Dewar
1997-05-07  0:00             ` Robert A Duff
1997-05-07  0:00               ` Robert Dewar
1997-05-08  0:00               ` Robert I. Eachus
1997-05-07  0:00             ` Robert Dewar
1997-05-07  0:00             ` Kevin Cline
1997-05-07  0:00               ` Jon S Anthony
1997-05-07  0:00               ` Robert Dewar
1997-05-07  0:00               ` Robert A Duff
1997-05-07  0:00               ` Matthew Heaney
1997-05-07  0:00                 ` Jon S Anthony
1997-05-09  0:00           ` Erik Magnuson
1997-05-10  0:00             ` Robert Dewar [this message]
1997-05-10  0:00               ` Matthew Heaney
1997-05-10  0:00             ` John G. Volan
1997-05-10  0:00               ` Robert Dewar
1997-05-10  0:00                 ` Matthew Heaney
1997-05-11  0:00                   ` Robert Dewar
1997-05-12  0:00               ` Erik Magnuson
1997-05-03  0:00     ` Jon S Anthony
     [not found] <199705010554.WAA24507@ni1.ni.net>
1997-05-01  0:00 ` W. Wesley Groleau (Wes)
1997-05-02  0:00   ` Robert Dewar
replies disabled

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