From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,3839fc233928a180 X-Google-Attributes: gid103376,public From: Stephen Leake Subject: Re: "free"ing allocated memory Date: 1997/11/18 Message-ID: <3471AC44.5CBD@gsfc.nasa.gov>#1/1 X-Deja-AN: 290456069 References: <34693B2D.C53FFFC3@access.hky.com> Organization: NASA Goddard Space Flight Center -- Greenbelt, Maryland USA Reply-To: Stephen.Leake@gsfc.nasa.gov Newsgroups: comp.lang.ada Date: 1997-11-18T00:00:00+00:00 List-Id: -- 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 ). 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