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.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,e7d9fee9b42cd34e X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!postnews.google.com!g10g2000cwb.googlegroups.com!not-for-mail From: "Anh Vo" Newsgroups: comp.lang.ada Subject: Re: Not null feature with anonymous and named access types Date: 14 Jun 2006 08:37:13 -0700 Organization: http://groups.google.com Message-ID: <1150299433.315551.41490@g10g2000cwb.googlegroups.com> References: <1150144396.104055.164310@f6g2000cwb.googlegroups.com> <6_kjg.4603$E02.1474@newsb.telia.net> <1150154013.951160.154270@j55g2000cwa.googlegroups.com> <15d5p0cbyr817.1vzzowtu2dayj$.dlg@40tude.net> <1150212476.630345.297100@c74g2000cwc.googlegroups.com> <4fana1F1i8fppU1@individual.net> NNTP-Posting-Host: 209.225.226.117 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: posting.google.com 1150299439 28816 127.0.0.1 (14 Jun 2006 15:37:19 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Wed, 14 Jun 2006 15:37:19 +0000 (UTC) In-Reply-To: <4fana1F1i8fppU1@individual.net> User-Agent: G2/0.2 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.1.4322),gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: g10g2000cwb.googlegroups.com; posting-host=209.225.226.117; posting-account=JVr7Xg0AAAAI3MbuARxMmvWLmA7qdJMx Xref: g2news2.google.com comp.lang.ada:4766 Date: 2006-06-14T08:37:13-07:00 List-Id: Alex R. Mosteo wrote: > > Agreed. However, memory leak occurs when the scope is complete in this > > case. Therefore, not null access should be used with extreme care. > > Otherwise, memory leak is almost certain. > > I don't see anything has radically changed in this respect since Ada95. You > expose in the spec a not null type and in body use some nullable type for > unchecked deallocations, if necessary. It is nice to have null excluded feature. However, memory can not be reclaimed, in this case, because of Constraint_Error raised when attempting to deallocate it. In Ada 95, null excluded not available, Constraint_Error will not be raised when deallocate the access object again in this case. AV