comp.lang.ada
 help / color / mirror / Atom feed
From: Caffeine Junky <nospam@hotmail.com>
Subject: Re: Unchecked Deallocation?
Date: Sat, 13 Jul 2002 00:52:34 GMT
Date: 2002-07-13T00:52:34+00:00	[thread overview]
Message-ID: <mRKX8.166938$Uu2.37175@sccrnsc03> (raw)
In-Reply-To: wcc65zk1qx9.fsf@shell01.TheWorld.com

On Fri, 12 Jul 2002 19:12:50 -0400, Robert A Duff wrote:

> Caffeine Junky <nospam@hotmail.com> writes:
> 
>> 	function Clear_Stack(S : in Stack) return Boolean;
> 
> You want a procedure, here, with an 'in out' parameter.  Not a function.
> You need to recursively free the whole list. Your instantiation of
> Unchecked_Deallocation is correct.
> 
>> 	  return True;	   -- No reason for it not to return True in this --
>> 				   -- instance, as far as I can tell.             --
> 
> Right, which is why you don't want a function.
> 
> - Bob
 
I get it! I really actually GET IT! For a change. And it works.

I seem to have an affinity for functions, and I dont know why. Any
rules of thumb on when it's a good idea to (use/not use)
functions and procedures in Ada95?

I'm also checking out Mr. Botton's example on 'Garbage Collection' over
at the Adapower website. Seems that taking that route might be simpler in
some regards.

Any good Ada references on memory managment you can point me to?

Thanks.

St4pL3



  reply	other threads:[~2002-07-13  0:52 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-07-12 22:44 Unchecked Deallocation? Caffeine Junky
2002-07-12 23:12 ` Robert A Duff
2002-07-13  0:52   ` Caffeine Junky [this message]
2002-07-13  3:00     ` R. Tim Coslet
2002-07-13  2:31   ` tmoran
2002-07-13  3:10     ` Caffeine Junky
replies disabled

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