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.7 required=5.0 tests=BAYES_00,FREEMAIL_FROM, FREEMAIL_REPLYTO,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-15 14:05:23 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!nntp.abs.net!news.voicenet.com!nntp.upenn.edu!msunews!not-for-mail From: "Chad R. Meiners" Newsgroups: comp.lang.ada Subject: Re: memory leakages with Ada? Date: Fri, 15 Mar 2002 16:59:22 -0500 Organization: Michigan State University Message-ID: References: <3c90af1e@news.starhub.net.sg> <3c91bfa3.1987537@news.demon.co.uk> <3C921A81.9060708@mail.com> Reply-To: "Chad R. Meiners" NNTP-Posting-Host: arctic.cse.msu.edu X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Xref: archiver1.google.com comp.lang.ada:21309 Date: 2002-03-15T16:59:22-05:00 List-Id: "Hyman Rosen" wrote in message news:3C921A81.9060708@mail.com... > The counter argument is that dangling pointers are a problem where they > have been copied into other data structures, so nulling one particular > variable which is holding the pointer isn't all that useful. Also, > freeing memory tends to happen as part of the process of cleaning up a > data structure which is itself about to disappear, so again nulling the > pointer isn't going to accomplish much. > This counter argument is weak at best since it is very poor design to allow more than one pointer to a block of allocated memory without having the ablility to invalidate them all when you deallocate that block. Therefore, since proper program design avoids the dangling pointer problem, nulling the pointer provides a useful safeguard against accessing deallocated memory. -CRM