Static variables in template functions
Paolo Carlini
pcarlini@suse.de
Sun Apr 17 07:55:00 GMT 2005
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.
More information about the Libstdc++
mailing list