From: "J-P. Rosen" <rosen@adalog.fr>
Subject: Re: Allocators for anonymous access return types
Date: Sun, 31 Oct 2010 13:46:16 +0100
Date: 2010-10-31T13:46:16+01:00 [thread overview]
Message-ID: <iajof0$fqn$1@news.eternal-september.org> (raw)
In-Reply-To: <87ocaa1rph.fsf@mid.deneb.enyo.de>
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
next prev parent reply other threads:[~2010-10-31 12:46 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-31 12:18 Allocators for anonymous access return types Florian Weimer
2010-10-31 12:46 ` J-P. Rosen [this message]
2010-10-31 13:23 ` Florian Weimer
2010-10-31 14:10 ` J-P. Rosen
2010-10-31 14:28 ` Florian Weimer
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox