std::string allocator
Paolo Carlini
pcarlini@suse.de
Mon Mar 6 15:35:00 GMT 2006
Stefan Olsson wrote:
>Hi folks,
>
>back with a new allocator related issue. Downloaded 4.1.0 and compiled with:
>--enable-shared --enable-threads=posix --disable-checking --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --host=i386-redhat-linux --enable-libstdcxx-allocator=mt --enable-languages=c,c++
>
>This way I can enjoy the performance of mt_alloc without having to specify it every time (or rather set up a global define for each type). Not quite though...
>...the std::string is defined in bits/stringfwd.h as:
>typedef basic_string<char> string;
>
>
Then string uses std::allocator<_CharT>, and since you passed
--enable-libstdcxx-allocator=mt at build time, the implementation of
std::allocator *is* mt_allocator:
template<typename _Tp>
class allocator: public __glibcxx_base_allocator<_Tp>
...
I don't understand...
Paolo.
More information about the Libstdc++
mailing list