This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: libstdc++ - version 3 default allocator


Sameer Atre wrote:

> How can I get the same behaviour in version 3 of libstdc++ when I want
> to change the default allocator for all containers.

Currently, there isn't an exact replacement, I'm afraid.

Either you build the whole library passing a specific
--enable-libstdcxx-allocator= option (see
http://gcc.gnu.org/onlinedocs/libstdc++/configopts.html) - thus changing
the default allocator for the entire library, not only the containers -
or you include from your code one of the allocators available under /ext
and then pass it to each container as the second template argument. I
would suggest experimenting a bit with the second possibility, as a start.

In general, 4.0.x is much better than any previous release series as far
as allocators are concerned.

Paolo.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]