This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Freeing xalloc'ed array


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]