comp.lang.ada
 help / color / mirror / Atom feed
From: "David C. Hoos" <david.c.hoos.sr@ada95.com>
Subject: Re: Storage Pools and alloca
Date: Tue, 15 Oct 2002 13:02:28 -0500
Date: 2002-10-15T13:02:28-05:00	[thread overview]
Message-ID: <mailman.1034704982.6910.comp.lang.ada@ada.eu.org> (raw)
In-Reply-To: OcYq9.38567$qb.6032@nwrddc01.gnilink.net


----- Original Message -----
From: "Frank J. Lhota" <NOSPAM.lhota.adarose@verizon.net>
Newsgroups: comp.lang.ada
To: <comp.lang.ada@ada.eu.org>
Sent: Tuesday, October 15, 2002 12:26 PM
Subject: Re: Storage Pools and alloca


> I should have been a little clearer. Ada has always allowed a programmer
to
> locally declare an object whose size can only be determined at runtime,
and
> this facility can be used in many places where C programmers would use
> "alloca". The way I should have worded this question is that given Ada's
> ability to declare dynamically sized objects, is there ever a need for an
> "alloca" storage pool? My educated guess would be no, but I thought it
might
> be worthwhile to run this idea past the Ada community.
The use of "declare blocks" in Ada is equivalent to the use of alloca in C.

For example:

declare
   The_String : constant String :=
<some-string-expression-of-unknown-length>;
begin
   <use The_String in some statement(s)>
end; -- The_String "deallocated" here where it goes out of scope




  reply	other threads:[~2002-10-15 18:02 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-15 15:42 Storage Pools and alloca Frank J. Lhota
2002-10-15 16:32 ` Matthew Heaney
2002-10-15 17:26   ` Frank J. Lhota
2002-10-15 18:02     ` David C. Hoos [this message]
2002-10-15 19:14 ` Robert A Duff
2002-10-15 20:23   ` Frank J. Lhota
2002-10-15 20:54     ` Robert A Duff
2002-10-16 13:42       ` Frank J. Lhota
2002-10-16  7:32     ` Eric G. Miller
2002-10-16 13:42       ` Frank J. Lhota
2002-10-19 20:30         ` Eric G. Miller
2002-10-16  5:20   ` Simon Wright
replies disabled

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