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=-2.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, MAILING_LIST_MULTI autolearn=unavailable autolearn_force=no version=3.4.4 X-Google-Thread: 103376,c68551ab190372c8 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!news.glorb.com!proxad.net!freenix!enst.fr!melchior!cuivre.fr.eu.org!melchior.frmug.org!not-for-mail From: "Christoph Karl Walter Grein" Newsgroups: comp.lang.ada Subject: Re: Ada memory management? Date: Thu, 07 Oct 2004 13:31:11 +0200 Organization: http://freemail.web.de/ Message-ID: NNTP-Posting-Host: lovelace.ada-france.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Trace: melchior.cuivre.fr.eu.org 1097148683 3845 212.85.156.195 (7 Oct 2004 11:31:23 GMT) X-Complaints-To: usenet@melchior.cuivre.fr.eu.org NNTP-Posting-Date: Thu, 7 Oct 2004 11:31:23 +0000 (UTC) To: comp.lang.ada@ada-france.org Return-Path: Precedence: fm-user X-Virus-Scanned: by amavisd-new-20030616-p10 (Debian) at ada-france.org X-BeenThere: comp.lang.ada@ada-france.org X-Mailman-Version: 2.1.4 List-Id: "Gateway to the comp.lang.ada Usenet newsgroup" List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Xref: g2news1.google.com comp.lang.ada:4865 Date: 2004-10-07T13:31:11+02:00 Jeff C r e e.m: > > Actually, no it shouldn't, not on a halfway-decent implementation. > > Logically speaking, a storage pool for items accessed via values of > > an access type has the same lifetime as the access type itself. In > > the above example, a new storage pool for Int_Ptr is created on > > entry to Does_This_Leak, and is removed on exit. > > > > Stephen > > -- > > > Stephen is correct...But just to be clear (because this is where people (not > Stephen) get confused is that the following > (much more common construct) would leak unless unchecked_deallocation is > used. No, he isn't, see my previous post! To get this effect, you have to define Storage_Size or a local storage pool. > package body Like_A_Sieve is > > type Int_Ptr is access Integer; > > procedure Does_This_Leak is > ptr: Int_Ptr; > begin > ptr := new Integer; > end Does_This_Leak; > > end Like_A_Sieve; But your example is also correct. __________________________________________________________ Mit WEB.DE FreePhone mit hoechster Qualitaet ab 0 Ct./Min. weltweit telefonieren! http://freephone.web.de/?mc=021201