comp.lang.ada
 help / color / mirror / Atom feed
From: Bob Duff <bobduff@theworld.com>
Subject: Re: Dynamic allocation in the predefined language environment
Date: Mon, 06 Jul 2015 10:06:10 -0400
Date: 2015-07-06T10:06:10-04:00	[thread overview]
Message-ID: <873811cre5.fsf@theworld.com> (raw)
In-Reply-To: 559a623d$0$293$14726298@news.sunsite.dk

Matthias-Christian Ott <ott@mirix.org> writes:

> Unbounded-length strings do not have this limitation but requires
> dynamic memory allocation (or at least I see no other way to implement
> it) which in turn requires error handling of memory allocation errors.
> However, if I'm not mistaken neither Ada 95, nor Ada 2005, nor Ada 2012
> specify how memory allocation errors are to be reported or handled and
> do not allow one to specify the storage pool from which unbounded-length
> strings are allocated. The same seems to be true for other
> unbounded/infinite data-structures.

Yes, the predefined containers packages unfortunately don't allow you to
specify the storage pool.

>...I suppose most implementations will
> raise a Storage_Error exception but the standard does not specify how
> the packages are to implemented so a program could simply crash and
> would still conform to the standard.

No, running out of memory raises Storage_Error.  The implementation
cannot "simply crash".

It's true that the standard does not specify how the packages are
implemented, but they still have to be implemented correctly.
There's nothing in the RM that says they can crash, so they
can't.

- Bob


  parent reply	other threads:[~2015-07-06 14:06 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-06 11:13 Dynamic allocation in the predefined language environment Matthias-Christian Ott
2015-07-06 13:04 ` G.B.
2015-07-06 14:21   ` Matthias-Christian Ott
2015-07-06 14:06 ` Bob Duff [this message]
2015-07-06 14:16   ` Matthias-Christian Ott
2015-07-06 14:23     ` G.B.
2015-07-06 14:43       ` Matthias-Christian Ott
2015-07-06 14:56         ` Bob Duff
2015-07-07  8:46           ` Matthias-Christian Ott
2015-07-07 22:32             ` Bob Duff
2015-07-08 19:47               ` Randy Brukardt
2015-07-08 21:08                 ` Bob Duff
2015-07-10 21:58                   ` Randy Brukardt
2015-07-08 21:16                 ` Dmitry A. Kazakov
2015-07-06 14:45     ` Bob Duff
2015-07-06 20:28       ` Randy Brukardt
2015-07-07  8:49       ` Matthias-Christian Ott
2015-07-07 22:14         ` Bob Duff
2015-07-06 15:29   ` Simon Wright
2015-07-06 20:31     ` Randy Brukardt
2015-07-06 21:35       ` Simon Wright
2015-07-07 18:29         ` Randy Brukardt
2015-07-06 20:22   ` Randy Brukardt
2015-07-06 18:45 ` Jeffrey R. Carter
2015-07-07  7:42 ` Dmitry A. Kazakov
2015-07-07  8:23   ` Matthias-Christian Ott
2015-07-07  8:46     ` Dmitry A. Kazakov
replies disabled

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