comp.lang.ada
 help / color / mirror / Atom feed
From: bobduff@world.std.com (Robert A Duff)
Subject: Re: Deallocating Task objects
Date: 1997/02/18
Date: 1997-02-18T00:00:00+00:00	[thread overview]
Message-ID: <E5t7tL.Asu@world.std.com> (raw)
In-Reply-To: 3309C668.7D8E@Sor.psu.edu


In article <3309C668.7D8E@Sor.psu.edu>,
Robert L. Spooner <rls19@psu.edu> wrote:
>For Ada 83 some memory had to be kept so that the task attributes such
>as T'terminated could be used.  I don't know enough about Ada (95) yet
>to know if it is still necessary.

The case is where a function returns a task object that is local to the
function.  I believe there was an Ada 83 AI that "clarified" that this
case was erroneous, so that storage for the task could be deallocated
upon leaving the function.  (In the standards business, "clarified" is a
euphemism for "fixing a bug in the language".  ;-))  Unfortunately, this
fix was made after ACVC tests had already forced implementers to keep
that storage around.

In Ada 95, this case raises Program_Error.  The error can actually be
caught at compile time, except in some cases involving generics -- a
good compiler will warn at compile time.

See AARM-6.5(20.a-20.d, 24.a-24.b) for some discussion of this stuff.

- Bob




  reply	other threads:[~1997-02-18  0:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-02-15  0:00 Deallocating Task objects Jonas Nygren
1997-02-15  0:00 ` Robert Dewar
1997-02-17  0:00 ` Mats Weber
1997-02-18  0:00   ` Robert L. Spooner
1997-02-18  0:00     ` Robert A Duff [this message]
1997-02-18  0:00       ` Robert Dewar
1997-02-20  0:00         ` Norman H. Cohen
1997-02-21  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