This is the mail archive of the
libstdc++@sourceware.cygnus.com
mailing list for the libstdc++ project.
Re: [Fwd: allocators not conformant to standard]
- To: Craig Perras <cperras@watchguard.com>, libstdc++ <libstdc++@sourceware.cygnus.com>
- Subject: Re: [Fwd: allocators not conformant to standard]
- From: "Matt Austern" <austern@isolde.engr.sgi.com>
- Date: Tue, 31 Aug 1999 13:06:10 -0700
- References: <37CC2CD5.25389D0E@watchguard.com>
- Reply-to: austern@sgi.com
Craig,
Sorry about not responding to your earlier message. Probably just a
momentary lapse of consciousness; I don't remember having seen it
before.
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().
--Matt