comp.lang.ada
 help / color / mirror / Atom feed
From: stt@henning.camb.inmet.com (Tucker Taft)
Subject: Re: GNAT memory allocation
Date: 1996/08/02
Date: 1996-08-02T00:00:00+00:00	[thread overview]
Message-ID: <DvIMCG.9qv.0.-s@inmet.camb.inmet.com> (raw)
In-Reply-To: 32013E73.33F8@isrc.sandia.gov


Henry W. Schneiderman (hwschne@isrc.sandia.gov) wrote:
: I've got a problem allocating memory using the GNAT Ada compiler v3.05
: on a Sun Sparc 10 w/ Solaris 2.4.   When I declare large arrays (on the
: order of 1 Meg) I get a core dump.  It seems like the memory for these
: large arrays is allocated from the stack.  Is there a way force storage
: of these arrays elsewhere in memory where there is more storage space --
: maybe something equivalent to the "static" statement in c?  Are there
: any pragmas that do this?

Objects declared inside (only) packages, as opposed to subprograms,
are equivalent to C's "static" -- they are allocated statically
rather than on the stack.  However, this presumes the size of
the array is known at compile-time.  If the size is not known at 
compile-time, the array may still end up on a "secondary" stack, 
or in the "heap," depending on the implementation.

You can also explicitly allocate an array in the heap using "new".

: Any help would be greatly appreciated!

: -Henry Schneiderman
: hwschne@isrc.sandia.gov or hws@cs.cmu.edu

-Tucker Taft   stt@inmet.com   http://www.inmet.com/~stt/
Intermetrics, Inc.  Cambridge, MA  USA




      parent reply	other threads:[~1996-08-02  0:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-08-01  0:00 GNAT memory allocation Henry W. Schneiderman
1996-08-01  0:00 ` Laurent Guerby
1996-08-02  0:00 ` Tucker Taft [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