startup allocation
Jason Merrill
jason@redhat.com
Sun Dec 9 07:31:00 GMT 2001
g++.eh/badalloc1.C recently began failing in the g++ testsuite. This
testcase overrides malloc to allocate from a small buffer, and it seems
that the amount of malloc memory needed by libstdc++ startup recently
increased dramatically. Investigating, I found that iostream
initialization initializes a locale, which initializes the standard
locales, which allocates a string "C", which allocates a 16-byte Rep, which
is allocated out of a 640-byte allocator chunk, which overflows my buffer.
Would it be possible to avoid doing these allocations at startup time,
either by doing them statically or deferring them longer? The less work
that we end up doing just because we link against libstdc++, the better.
Jason
More information about the Libstdc++
mailing list