comp.lang.ada
 help / color / mirror / Atom feed
From: Simon Wright <simon@pushface.org>
Subject: Re: Is the Ada run-time required to detect out-of-memory conditions?
Date: 22 May 2004 12:40:35 +0100
Date: 2004-05-22T12:40:35+01:00	[thread overview]
Message-ID: <x7v7jv4vgek.fsf@smaug.pushface.org> (raw)
In-Reply-To: 87isepl9c9.fsf@insalien.org

Ludovic Brenta <ludovic.brenta@insalien.org> writes:

> I forgot to point you at one of Ada's neat features called
> "User-Defined Storage Pools".  Look at the Ada Reference Manual[1]
> section 13.11.  You can define your own allocation and deallocation
> mechanism for any access type; your storage pool may for example
> preallocate X megabytes from the operating system, allocate from that
> buffer, and raise Storage_Error when it is exhausted.  As long as X <=
> Physical_Ram, you then have a guarantee that your porgram receives
> Storage_Error and not SIGKILL.

The easiest way to do this is to specify the storage size for the
access type:

   type S is access ...;
   for S'Storage_Size use ...;   --  in storage elements

ALRM 3.11(18):

   If Storage_Size is specified for an access type, then the
   Storage_Size of this pool is at least that requested, and the
   storage for the pool is reclaimed when the master containing the
   declaration of the access type is left. If the implementation
   cannot satisfy the request, Storage_Error is raised at the point of
   the attribute_definition_clause. If neither Storage_Pool nor
   Storage_Size are specified, then the meaning of Storage_Size is
   implementation defined.

-- 
Simon Wright                               100% Ada, no bugs.



  reply	other threads:[~2004-05-22 11:40 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-05-20 22:54 Is the Ada run-time required to detect out-of-memory conditions? Ludovic Brenta
2004-05-21  0:44 ` Georg Bauhaus
2004-05-21  0:47 ` Stephen Leake
2004-05-21  0:54   ` Georg Bauhaus
2004-05-21  1:00     ` Stephen Leake
2004-05-21  3:29 ` Robert I. Eachus
2004-05-21  8:04 ` Vinzent 'Gadget' Hoefler
2004-05-21  9:34   ` Martin Krischik
2004-05-21 11:13 ` Wojtek Narczynski
2004-05-21 12:55   ` Martin Krischik
2004-05-21 16:00     ` Robert I. Eachus
2004-05-21 17:13       ` Ludovic Brenta
2004-05-21 23:41         ` Wojtek Narczynski
2004-05-23  8:20       ` Martin Krischik
2004-05-21 19:58   ` Randy Brukardt
2004-05-21 16:56 ` Mark H Johnson
2004-05-21 17:19   ` Ludovic Brenta
2004-05-21 21:39 ` user
2004-05-21 22:04   ` Ludovic Brenta
2004-05-21 22:11     ` Ludovic Brenta
2004-05-22 11:40       ` Simon Wright [this message]
2004-05-25 20:43     ` Is the Ada run-time required to detect out-of-memory Robert I. Eachus
2004-05-25 20:58       ` Duncan Sands
2004-05-25 21:19       ` Ludovic Brenta
2004-05-25 21:31         ` Duncan Sands
2004-05-26  7:09       ` Martin Krischik
2004-05-26  7:38         ` Duncan Sands
2004-05-26  8:16           ` Martin Krischik
2004-05-26  8:34             ` Duncan Sands
2004-05-26 16:20               ` Martin Krischik
2004-05-22 13:40   ` Is the Ada run-time required to detect out-of-memory conditions? Duncan Sands
2004-05-22 14:09     ` Martin Krischik
replies disabled

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