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.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,e7d9fee9b42cd34e X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!news3.google.com!news2.volia.net!npeer.de.kpn-eurorings.net!newsfeed.arcor.de!news.arcor.de!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: Not null feature with anonymous and named access types Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <1150144396.104055.164310@f6g2000cwb.googlegroups.com> <6_kjg.4603$E02.1474@newsb.telia.net> <1150154013.951160.154270@j55g2000cwa.googlegroups.com> Date: Tue, 13 Jun 2006 09:53:41 +0200 Message-ID: <15d5p0cbyr817.1vzzowtu2dayj$.dlg@40tude.net> NNTP-Posting-Date: 13 Jun 2006 09:53:33 MEST NNTP-Posting-Host: 4d57ed74.newsread2.arcor-online.net X-Trace: DXC=;9WoeXZMhMCVg>C^g8i1FIQ5U85hF6f;DjW\KbG]kaMH[NGU2GAcMGJ6DQ8mU0GR8MWRXZ37ga[7JjTA67ckJ=XEeOfJkNJ`:fF X-Complaints-To: usenet-abuse@arcor.de Xref: g2news2.google.com comp.lang.ada:4757 Date: 2006-06-13T09:53:33+02:00 List-Id: On 12 Jun 2006 16:13:34 -0700, Anh Vo wrote: > Bj�rn Persson wrote: >> Anh Vo wrote: >>> I have been exploring the not null feature with anonymous access type >>> and named access type. One thing have learned that an access variable >>> declared based on these types will raise a Constraint_Error when >>> deallocating this access variable as shown in the code below. >> >> Of course. Deallocation sets the access variable to null, and that >> violates the not-null constraint. >> > Thanks for your quick reply. > > Based on this requirement, one should not use not null access in this > case due to memory leak as the result of memory deallocation > incapability. Often memory management and handling objects should be well separated. In public interfaces, where pointers are needed, null access types can be very useful. This by no means should prevent the implementation interfaces from using plain pointers, arena allocators, garbage collectors, etc to manage memory. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de