This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: Static variables in template functions
- From: Paolo Carlini <pcarlini at suse dot de>
- To: mark at codesourcery dot com
- Cc: libstdc++ at gcc dot gnu dot org, nathan at codesourcery dot com, jason at redhat dot com
- Date: Sun, 17 Apr 2005 09:56:10 +0200
- Subject: Re: Static variables in template functions
- References: <200504170430.j3H4U5fk017819@sirius.codesourcery.com>
Hi Mark,
>PR 18681 describes several V3 testsuite failures that occur on AIX
>4.3. These problems could almost certainly be reproduced on other
>systems without weak symbol support.
>
>One of the problems comes from the fact that V3 is using initialized
>static variables in template functions. In particular, in
>mt_allocator.h, _S_get_pool does:
>
> const static size_t __align = (__alignof__(_Tp) >= sizeof(_Block_record)
> ? __alignof__(_Tp)
> : sizeof(_Block_record));
>
>
[snip]
>Thoughts?
>
>
Probably, during the next days I will not be able to follow the
technical details of this issue, however, I want to point out clearly
something that maybe is not completely obvious in the message: the
problem occurs in the __per_type_pool_policy, definitely *not* the
default memory allocation policy and, IMO, one that very few people are
going to use. This means that, if the problematic construct doesn't
appear elsewhere, its performance are definitely not critical for the
performance of our library as a whole and I have no problem with any
resolution.
Thanks,
Paolo.