comp.lang.ada
 help / color / mirror / Atom feed
From: "Jeffrey R. Carter" <spam@spam.com>
Subject: Re: Unchecked deallocation issues
Date: Fri, 09 Dec 2005 06:40:01 GMT
Date: 2005-12-09T06:40:01+00:00	[thread overview]
Message-ID: <5F9mf.1706$Tg2.1577@newsread1.news.pas.earthlink.net> (raw)
In-Reply-To: <1134105321.360940.260560@o13g2000cwo.googlegroups.com>

ejijott@gmail.com wrote:

> Right.. code snippet above is a part of my BST Remove() handling. The
> issue I'm having is using unchecked deallocation... what im figuring
> here is that my Free() procedure frees the part of memory that contains
> my value, but does nothing to the pointer itself. So, if I just call
> Free() on an value-pointed-to and directly after print out
> value-pointed-to it _could_ still print out whatever it contains, but
> it could change at any time due to the fact that that part of memory is
> part of the pool again? And to solve this, I should set the pointer of
> the pointed-to-value to null ... is my implementation of this correct,
> as in this snippet:
> 
>                     Free(Node);
>                     Node:=null;

ARM 13.11.2: "After executing Free(X), the value of X is null. [where Free is an 
instantiation of Ada.Unchecked_Deallocation]"

-- 
Jeff Carter
"Why don't you bore a hole in yourself and let the sap run out?"
Horse Feathers
49



  reply	other threads:[~2005-12-09  6:40 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-09  5:15 Unchecked deallocation issues ejijott
2005-12-09  6:40 ` Jeffrey R. Carter [this message]
2005-12-09  9:22   ` ejijott
2005-12-09 10:06     ` Alex R. Mosteo
2005-12-09 10:18     ` Niklas Holsti
2005-12-09  6:44 ` Jeffrey R. Carter
replies disabled

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