comp.lang.ada
 help / color / mirror / Atom feed
From: Stephen Leake <Stephen.Leake@gsfc.nasa.gov>
Subject: Re: "free"ing allocated memory
Date: 1997/11/18
Date: 1997-11-18T00:00:00+00:00	[thread overview]
Message-ID: <3471AC44.5CBD@gsfc.nasa.gov> (raw)
In-Reply-To: 34693B2D.C53FFFC3@access.hky.com


-- Randy Kosarik wrote:
> 
> (This is the 4th time I am trying to send this to the newsgroup so,
> please disregard any copies if they make it here.... ISP has a
> newsserver problem)
> 
> Hi,
> 
> I have a project in school that is completed with the exception of one
> part. Releasing the memory that I am no longer using in
> my linked lists. While the program would never use all of the memory in
> the machine, I do not like the idea of making my code
> any sloppier than I already do (experience should remove my wasteful
> code <HOPEFULLY!>).

A great attitude; you'll make a great programmer someday.

> I allocate/create the new memory blocks with this routine.. But I cannot
> seem to figure out how to "free" the memory in Ada.

You need to instantiate Ada.Unchecked_Conversion; look in your text or
ask your prof for details (s/he may be postponing teaching this for a
good reason). The "Unchecked" in the name is a warning that you are
responsible for ensuring you don't "free" something that is still being
used; this is known as the "dangling pointer" problem.

- Stephe




      parent reply	other threads:[~1997-11-18  0:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-11-12  0:00 "free"ing allocated memory Randy Kosarik
1997-11-16  0:00 ` Jerry van Dijk
1997-12-16  0:00   ` Pascal MALAISE
1997-11-18  0:00 ` Stephen Leake [this message]
replies disabled

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