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=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,cc05aeb5e0d8b475 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-09-14 04:57:58 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!syros.belnet.be!news.belnet.be!feed.news.nacamar.de!newsfeed.freenet.de!194.168.222.61.MISMATCH!newspeer1-gui.server.ntli.net!ntli.net!newsfep4-glfd.server.ntli.net.POSTED!53ab2750!not-for-mail From: chris User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5b) Gecko/20030903 Thunderbird/0.2 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Free-ing memory: not springing leaks? References: <2TM8b.1013$Nb6.297@newsfep4-winn.server.ntli.net> In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Message-ID: <9JY8b.1963$WI3.25442@newsfep4-glfd.server.ntli.net> Date: Sun, 14 Sep 2003 13:02:12 +0200 NNTP-Posting-Host: 81.98.236.164 X-Complaints-To: abuse@ntlworld.com X-Trace: newsfep4-glfd.server.ntli.net 1063540677 81.98.236.164 (Sun, 14 Sep 2003 12:57:57 BST) NNTP-Posting-Date: Sun, 14 Sep 2003 12:57:57 BST Organization: ntl Cablemodem News Service Xref: archiver1.google.com comp.lang.ada:42474 Date: 2003-09-14T13:02:12+02:00 List-Id: Matthew Heaney wrote: >>I vaguely recall reading somewhere that in general you shouldn't free C >>allocated memory from Ada, but perhaps I was mistaken? > > > No, you are correct: don't do that. Thanks for the advice. What if there is no call to free memory? For example, the library loader for linux error mechanism is to return an error msg describing the problem. Once you have it appears to be your problem what you do with it. There is no call present in the library to return the memory. Should I bind to a C compiled function to do this? Perhaps in the case of linux, to the free function in the std lib? I guess you are left to free it yourself in C because it provides "free" and it is natural to use it in C. Chris