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!news2.google.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:15:58 +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 1097147789 1028 212.85.156.195 (7 Oct 2004 11:16:29 GMT) X-Complaints-To: usenet@melchior.cuivre.fr.eu.org NNTP-Posting-Date: Thu, 7 Oct 2004 11:16:29 +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:4863 Date: 2004-10-07T13:15:58+02:00 Stephen Thomas: > > procedure Does_This_Leak is > > type Int_Ptr is access Integer; > > ptr: Int_Ptr; > > begin > > ptr := new Integer; > > end Does_This_Leak; > > > > Of course this leaks, and imagine how much! > > 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. RM 13.11(17) If Storage_Pool is not specified ... then the implementation chooses a standard storage pool .. in an implementation-defined manner. So how do you arrive at this statement? But see RM 13.11(18): The case is different if a Storage_Size is defined. __________________________________________________________ Mit WEB.DE FreePhone mit hoechster Qualitaet ab 0 Ct./Min. weltweit telefonieren! http://freephone.web.de/?mc=021201