This is the mail archive of the
libstdc++@sourceware.cygnus.com
mailing list for the libstdc++ project.
Re: locale/purify results
On Thu, Mar 30, 2000 at 04:17:03PM -0800, Benjamin Kosnik wrote:
> [Re: purify complains about undeallocated memory at termination time]
>
> why leak at all though?
It's more efficient to leak memory, sometimes enormously so.
In this case, we have a reference-counted object with an artificially
increased reference count. That means that when the last reference
goes away, the object isn't destroyed; which means the next time you
need it, it's still there and doesn't need to be constructed again.
One alternative is to construct it statically; then the memory is
consumed, and time is spent initializing, even if the program never
actually uses it.
Lazy allocations and lazy initialization are _good_. If Purify can't
be persuaded to tolerate them (which nobody has asserted, yet) then
it's a bug in Purify.
Can somebody provide the magic formula to mollify Purify?
Nathan Myers
ncm@nospam.cantrip.org