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=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,b1a1671673a84c5e X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!news3.google.com!proxad.net!feeder1-2.proxad.net!newsfeed.straub-nv.de!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: "J-P. Rosen" Newsgroups: comp.lang.ada Subject: Re: Allocators for anonymous access return types Date: Sun, 31 Oct 2010 13:46:16 +0100 Organization: Adalog Message-ID: References: <87ocaa1rph.fsf@mid.deneb.enyo.de> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Injection-Date: Sun, 31 Oct 2010 12:46:24 +0000 (UTC) Injection-Info: mx01.eternal-september.org; posting-host="O1RkH+WVNUV47UyqsXe2BA"; logging-data="16215"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+0/m4h4Y/7hqlAyHISTrR/" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.9.2.12) Gecko/20101027 Thunderbird/3.1.6 In-Reply-To: <87ocaa1rph.fsf@mid.deneb.enyo.de> Cancel-Lock: sha1:3RhyJYQ1XzegJW7IIFwoTIuOeZI= Xref: g2news1.google.com comp.lang.ada:15038 Date: 2010-10-31T13:46:16+01:00 List-Id: Le 31/10/2010 13:18, Florian Weimer a �crit : > It seems that an allocator for an anonymous accesss return type of a > library-level function essentially leaks memory (unless you use > garbage collection, of course). Is this really the case? I would > expect such objects to be deallocated by the master for the expression > where the return type occurs. Yes, but I *guess* the master is library-level, therefore it's deallocated only when the problem terminates. I said "I guess", because few people (even in the ARG!) really understand accessibility levels. Moreover, there is no way to unchecked-deallocate anonymous access types. Conclusion: don't use them, especially with allocators. Use named types as much as possible. -- --------------------------------------------------------- J-P. Rosen (rosen@adalog.fr) Adalog a d�m�nag� / Adalog has moved: 2 rue du Docteur Lombard, 92441 Issy-les-Moulineaux CEDEX Tel: +33 1 45 29 21 52, Fax: +33 1 45 29 25 00