about libstdc++ ,change the defaule allocator
Xin LI
delphij at gmail.com
Thu Jan 14 18:54:50 UTC 2010
2010/1/13 Jiandong Lu <lujiandong1001 at yahoo.com.cn>:
> hello,everyone.
> I get the current source code from svn,and successfully build world.
> c++'s standard library is from gnu. This library privodes many allocators:
> bitmap_allocator_base
> malloc_allocator_base
> mt_allocator_base
> new_allocator_base
> pool_allocator_base
> I want to know how to set a default allocator,and how to change it.
>
> I have read the Makefile:
> /usr/src/gnu/lib/libstdc++/Makefile
I have no idea why you will think the allocator is being changed here...
The standard and portable way to override the allocator is at the
point you instance C++ templates by specifing Allocator parameter.
If, however, you want to globally change the default allocator without
touching all your source files, the only way is to make modification
on c++allocator.h, which is, in my opinion, never permitted by the
standard and banned by god.
Cheers,
--
Xin LI <delphij at delphij.net> http://www.delphij.net
More information about the freebsd-hackers
mailing list