This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: Bugs/non-portable assumptions in libstdc++
- From: Benjamin Kosnik <bkoz at redhat dot com>
- To: Chris Lattner <sabre at nondot dot org>
- Cc: libstdc++ at gcc dot gnu dot org
- Date: Fri, 19 Nov 2004 15:35:14 -0600
- Subject: Re: Bugs/non-portable assumptions in libstdc++
- Organization: Red Hat / Chicago
- References: <Pine.LNX.4.44.0411191140220.30278-100000@nondot.org>
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.