From: Maciej Sobczak <see.my.homepage@gmail.com>
Subject: Re: Allocators and exceptions
Date: Mon, 10 Sep 2007 14:58:10 -0700
Date: 2007-09-10T14:58:10-07:00 [thread overview]
Message-ID: <1189461490.270038.235840@50g2000hsm.googlegroups.com> (raw)
In-Reply-To: <1189439048.467517.186160@19g2000hsx.googlegroups.com>
On 10 Wrz, 17:44, Adam Beneschan <a...@irvine.com> wrote:
> I don't think this can be guaranteed, not as I read 4.8(10).
[...]
> The message here,
> I think, is that the Ada language has said that it doesn't worry about
> storage reclamation; you have to worry about that yourself.
That's OK for me as long as I'm given necessary tools for this. The
problem is that with exceptions I cannot even be sure that I have the
access value. Without it "worrying about that myself" is at least
challenging.
> Anyway, if this is an issue, I'd write a function to perform the "new"
> operation. Using your later example:
>
> function new_T (Init : Integer) return T_Access is
> begin
> declare
> New_Rec : T (Init);
> begin
> return new T' (New_Rec);
> end;
> exception
> when others => ...
> end new_T;
OK, so let's complicate it a bit - T is limited. :-)
I know that it can be hacked around. I just did not expect Ada to put
me in the position that would require hacking something around.
> Now any exceptions involved in initializing the record will get caught
> before allocation takes place. The allocator itself won't raise any
> exceptions (other than Storage_Error), unless copying New_Rec to the
> newly allocated object raises an exception, which could happen only if
> there are controlled types involved and an Adjust routine raises an
> exception, in which case you're in a whole bunch of trouble anyway.
Yeah, that's my other disappointment in this area - assignment cannot
be made "atomic" in the transactional sense.
--
Maciej Sobczak
http://www.msobczak.com/
next prev parent reply other threads:[~2007-09-10 21:58 UTC|newest]
Thread overview: 55+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-09-09 7:40 Allocators and exceptions Maciej Sobczak
2007-09-09 12:17 ` anon
2007-09-09 20:31 ` Maciej Sobczak
2007-09-09 22:43 ` Simon Wright
2007-09-10 12:10 ` Maciej Sobczak
2007-09-10 19:08 ` Simon Wright
2007-09-10 2:56 ` anon
2007-09-10 12:42 ` Dmitry A. Kazakov
2007-09-10 21:48 ` Maciej Sobczak
2007-09-11 9:16 ` Dmitry A. Kazakov
2007-09-11 9:19 ` Maciej Sobczak
2007-09-11 12:27 ` Dmitry A. Kazakov
2007-09-11 19:07 ` Maciej Sobczak
2007-09-11 22:56 ` Georg Bauhaus
2007-09-12 12:36 ` Maciej Sobczak
2007-09-12 22:19 ` Randy Brukardt
2007-09-12 9:32 ` Dmitry A. Kazakov
2007-09-12 12:42 ` Maciej Sobczak
2007-09-12 15:25 ` Dmitry A. Kazakov
2007-09-12 12:29 ` Stephen Leake
2007-09-12 12:46 ` Maciej Sobczak
2007-09-12 20:53 ` Simon Wright
2007-09-12 22:32 ` Randy Brukardt
2007-09-12 23:43 ` Simon Wright
2007-09-13 3:42 ` Randy Brukardt
2007-09-13 3:36 ` Randy Brukardt
2007-09-13 9:43 ` Maciej Sobczak
2007-09-12 22:25 ` Randy Brukardt
2007-09-13 11:51 ` Stephen Leake
2007-09-12 14:14 ` Markus E L
2007-09-10 10:37 ` Allocators and exceptions => Read Me First anon
2007-09-10 12:16 ` Maciej Sobczak
2007-09-10 22:10 ` Allocators and exceptions => Trying Again anon
2007-09-10 23:15 ` Markus E L
2007-09-10 15:44 ` Allocators and exceptions Adam Beneschan
2007-09-10 21:58 ` Maciej Sobczak [this message]
2007-09-10 22:07 ` Jeffrey R. Carter
2007-09-11 9:14 ` Dmitry A. Kazakov
2007-09-11 9:23 ` Maciej Sobczak
2007-09-11 2:36 ` Randy Brukardt
2007-09-11 15:33 ` Adam Beneschan
2007-09-11 19:21 ` Maciej Sobczak
2007-09-11 21:56 ` Adam Beneschan
2007-09-12 0:34 ` Jeffrey R. Carter
2007-09-12 12:13 ` Maciej Sobczak
2007-09-12 16:34 ` Jeffrey R. Carter
2007-09-12 23:50 ` Jeffrey R. Carter
2007-09-12 12:22 ` Maciej Sobczak
2007-09-12 14:11 ` Markus E L
2007-09-12 16:08 ` Adam Beneschan
2007-09-12 20:35 ` Dmitry A. Kazakov
2007-09-12 21:01 ` Adam Beneschan
2007-09-12 22:45 ` Randy Brukardt
2007-09-13 7:48 ` Dmitry A. Kazakov
2007-09-12 3:08 ` Allocators and exceptions -- Debugging says memory leak! anon
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox