[Fwd: allocators not conformant to standard]

Matt Austern austern@isolde.engr.sgi.com
Tue Aug 31 13:06:00 GMT 1999


Sorry about not responding to your earlier message.  Probably just a
momentary lapse of consciousness; I don't remember having seen it

In any case, though, our default allocator does take a hint parameter.
(If you've got __STL_USE_STD_ALLOCATORS defined, that is.  I'm talking
about the allocator<> class, which attempts to be standard-conforming,
rather than the alloc class, which does not.)  See allocator<>::allocate(),
in line 602 of stl_alloc.h.  As you'll see, we have a hint parameter and
we don't do anything with it.

Unfortunately, passing the address of the container as a hint would not
be standard-conforming.  If you combine what tables 31 and 32 say, you'll
see that the hint parameter must be either a null pointer or else something
returned by a previous call to allocate().


More information about the Libstdc++ mailing list