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,345a8b767542016e X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-03-19 09:12:58 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!tor-nx1.netcom.ca!news1.tor.metronet.ca!nnrp1.tor.metronet.ca!not-for-mail Message-ID: <3C97713C.1040805@home.com> From: "Warren W. Gay VE3WWG" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:0.9.4) Gecko/20011128 Netscape6/6.2.1 X-Accept-Language: en-us MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: memory leakages with Ada? References: <3c90af1e@news.starhub.net.sg> <3c91bfa3.1987537@news.demon.co.uk> <3C921A81.9060708@mail.com> <3C962624.5080008@home.com> <3c97027d.1284426@news.demon.co.uk> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Date: Tue, 19 Mar 2002 17:11:24 GMT NNTP-Posting-Host: 198.96.47.195 NNTP-Posting-Date: Tue, 19 Mar 2002 10:11:24 MDT Organization: MetroNet Communications Group Inc. Xref: archiver1.google.com comp.lang.ada:21459 Date: 2002-03-19T17:11:24+00:00 List-Id: John McCabe wrote: > On Mon, 18 Mar 2002 17:38:46 GMT, "Warren W. Gay VE3WWG" > wrote: > >>My own personal observation is that C/C++ programmers will err on the >>side of efficiency, rather than safety. After a free()/delete, they'll >>usually not set the pointer to null. > > I'd never really thought of it as an efficiency issue but, having used > C++ for about 8 months now almost full-time I've got to the stage of > pretty much setting all pointers to NULL after a delete, unless > they're in a destructor (as it does seem like a waste of time there). > > Something else about unchecked deallocation, as far as I can remember, > is that if you give it a null pointer it doesn't do anything. This is > nice (but in a way it can make you lazy :-) If this is true, this is bad IMHO. I'd rather know by an exception that I was trying to free something that was "no more", than to go glibly forward. I'll have to test this on GNAT sometime. -- Warren W. Gay VE3WWG http://home.cogeco.ca/~ve3wwg