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.3 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, REPLYTO_WITHOUT_TO_CC autolearn=no 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:45:04 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!t-online.de!deine.net!freenix!enst!enst.fr!not-for-mail From: "David C. Hoos" Newsgroups: comp.lang.ada Subject: Re: memory leakages with Ada? Date: Tue, 19 Mar 2002 11:51:47 -0600 Organization: ENST, France Sender: comp.lang.ada-admin@ada.eu.org Message-ID: 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> <3C97713C.1040805@home.com> Reply-To: comp.lang.ada@ada.eu.org NNTP-Posting-Host: marvin.enst.fr Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Trace: avanie.enst.fr 1016559902 41008 137.194.161.2 (19 Mar 2002 17:45:02 GMT) X-Complaints-To: usenet@enst.fr NNTP-Posting-Date: Tue, 19 Mar 2002 17:45:02 +0000 (UTC) Return-Path: X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Errors-To: comp.lang.ada-admin@ada.eu.org X-BeenThere: comp.lang.ada@ada.eu.org X-Mailman-Version: 2.0.8 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: comp.lang.ada mail<->news gateway List-Unsubscribe: , Errors-To: comp.lang.ada-admin@ada.eu.org X-BeenThere: comp.lang.ada@ada.eu.org Xref: archiver1.google.com comp.lang.ada:21461 Date: 2002-03-19T11:51:47-06:00 One problem with expecting an exception to be raised is that if the once-freed memory has been re-allocated it's impossible to discern whether an access value was set by the original or by the subsequent allocation. Hence, the desirability of setting access values to null on deallocation. ----- Original Message ----- From: "Warren W. Gay VE3WWG" Newsgroups: comp.lang.ada To: Sent: Tuesday, March 19, 2002 11:11 AM Subject: Re: memory leakages with Ada? > 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 > > _______________________________________________ > comp.lang.ada mailing list > comp.lang.ada@ada.eu.org > http://ada.eu.org/mailman/listinfo/comp.lang.ada >