comp.lang.ada
 help / color / mirror / Atom feed
From: Simon Wright <simon@pushface.org>
Subject: Re: Deallocating an object twice
Date: Sun, 27 Jul 2014 09:31:39 +0100
Date: 2014-07-27T09:31:39+01:00	[thread overview]
Message-ID: <lytx63qk2c.fsf@pushface.org> (raw)
In-Reply-To: lr1142$log$1@speranza.aioe.org

Victor Porton <porton@narod.ru> writes:

> If I understand correctly, it is an undefined behavior (or is it called 
> unbounded error?) if a pool access is deallocated twice with 
> Unchecked_Deallocation.
>
> I think it should be a Program_Error (if checks are on).
>
> Why was not this done even in Ada2012 (not speaking about older Ada)?
>
> It's bad.
>
> Or is it done and I just miss it?

If done at all, this check would be at a low level. AdaCore offer a
Debug Pool facility[1]. Of course, this wouldn't detect a C program
using free() on data allocated in Ada; you'd have to go lower, perhaps
using a tool like valgrind[2].

[1]
https://gcc.gnu.org/onlinedocs/gnat_ugn_unw/The-GNAT-Debug-Pool-Facility.html
[2] http://valgrind.org

  parent reply	other threads:[~2014-07-27  8:31 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-26 19:55 Deallocating an object twice Victor Porton
2014-07-26 20:02 ` Victor Porton
2014-07-27  2:39   ` Randy Brukardt
2014-07-27  2:42   ` Randy Brukardt
2014-07-27  8:31 ` Simon Wright [this message]
2014-07-27 11:30 ` anon
2014-07-27 12:47   ` Peter Chapin
2014-07-27 15:29 ` Stephen Leake
2014-07-27 15:34   ` Victor Porton
2014-07-28 15:15     ` Stephen Leake
2014-07-28 16:15       ` Simon Wright
replies disabled

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