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


>>> "Jonathan" == Jonathan Wakely <cow@compsoc.man.ac.uk> writes:

 > On Wed, Oct 13, 2004 at 11:26:20AM +0200, Paolo Carlini wrote:

Thanks for the answer.

 >> 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();

For my information, what's the rationale for them not to be destroyed?
And why do these reasons imply that the xalloc'd memory for std
streams is not to be reclaimed?

 >> 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 try to write one for this case, thanks for the tip.


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