This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: Freeing xalloc'ed array
- From: Jonathan Wakely <cow at compsoc dot man dot ac dot uk>
- To: Paolo Carlini <pcarlini at suse dot de>
- Cc: Akim Demaille <akim at epita dot fr>, libstdc++ at gcc dot gnu dot org
- Date: Wed, 13 Oct 2004 12:40:42 +0100
- Subject: Re: Freeing xalloc'ed array
- References: <mv4mzyrqamw.fsf@nostromo.lrde.epita.fr> <416CF4BC.6030204@suse.de>
On Wed, Oct 13, 2004 at 11:26:20AM +0200, Paolo Carlini wrote:
> More specifically, there is this comment in ios_base.h that explains why you
> are seeing it (note that you are calling iword on cout, a standard stream):
>
> // Destructor
> /**
> * Invokes each callback with erase_event. Destroys local storage.
> *
> * Note that the ios_base object for the standard streams never gets
> * destroyed. As a result, any callbacks registered with the standard
> * streams will not get invoked with erase_event (unless copyfmt is
> * used).
> */
> virtual ~ios_base();
I'll add that the the FAQ then, IIRC it only specifically says you should
expect to see leaks from the containers, not the standard streams as
well.
> Forgot to add: professional programmer arounds, using gcc + valgrind often
> prepare custom suppression files, in order to avoid spurious entries in the
> valgrind reports (I'm sure they do that at CERN, f.i.)
I'll mention that too.
I've got a few things queued to be changed in the docs. I will get
round to them, I've just been enjoying doing the TR1 stuff more.
jon
--
"A thing is not necessarily true because a man dies for it."
- Oscar Wilde