comp.lang.ada
 help / color / mirror / Atom feed
From: tmoran@bix.com
Subject: Re: Very basic questions about memory allocation
Date: 1999/07/31
Date: 1999-07-31T00:00:00+00:00	[thread overview]
Message-ID: <r3ro3.763$U5.44453@typhoon-sf.snfc21.pbi.net> (raw)
In-Reply-To: MPG.120aa15a110a18ff989940@news.bcn.ttd.net

> type t is ....
> ...
> v:access t;
> begin
>         v:=new t;
> end;
  Are you sure you need heap allocation?  Since Ada allows highly
dynamic stack allocation, there is much less need for "new" and "free".
For instance, if "type t is array(integer range <>) of something;"
and X is a floating point number,
  v : t(integer(sqrt(X/2.0)) .. integer(sqrt(X)));
is perfectly legal Ada.  You can just let the compiler handle the
space allocation and deallocation.




      parent reply	other threads:[~1999-07-31  0:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-07-30  0:00 Very basic questions about memory allocation JIMHER@yanoesladirecci�n.com
1999-07-30  0:00 ` Frank Ecke
1999-08-01  0:00   ` JIMHER@yanoesladirecci�n.com
1999-07-31  0:00 ` tmoran [this message]
replies disabled

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