[RFC] allocator reorg

Carlo Wood carlo@alinoe.com
Wed Jun 11 21:38:00 GMT 2003


On Wed, Jun 11, 2003 at 12:31:04PM -0700, Nathan Myers wrote:
> There's no need for the different allocation strategies to be
> bound to different types.  A single allocator type may vary its
> behavior at runtime or (probably much better) at link time 
> according to the presence of thread-related symbols.

This is a much better idea.  Otherwise I fear for problems
where a std::string type of a shared library that was distributed
as binary is not the same as what the host that uses the
shared library thinks it is.

Consider a 'RedHat' distributing an i386.rpm's containing
shared C++ libraries - and a user trying to link with a
costum compiled application that uses a different underlying
default allocator (because he has, or hasn't, SMP).

When the *type* 'std::string' (and all other STL types that
contain the default allocator) is always the *same* type,
then you won't have that kind of problems.  This means
that the allocator type should be the same at all times
(for a given version of libstdc++).

-- 
Carlo Wood <carlo@alinoe.com>



More information about the Libstdc++ mailing list