Bugs/non-portable assumptions in libstdc++
Benjamin Kosnik
bkoz@redhat.com
Fri Nov 19 21:35:00 GMT 2004
Yo Chris.
>From my understanding of the standard, I don't think that this is a legal
>optimization to make. You are assuming that unconstructed memory starts
>out zero initialized, which is not always the case. Granted, this is the
>case on unix and many other systems for static members, because the OS
>zeros out pages before giving them to the process. However, I believe it
>still is making non-standard assumptions.
Order of static initialization issues are more of an issue,
portability-wise*. In general, because of this, we are moving to
returning references to static locals. See the __mt_alloc design.
For the rest, I think Paolo and Nathan have already addressed your question..
best,
-benjamin
* SVR4 vs. the rest of the world.
More information about the Libstdc++
mailing list