RFC: Hint parameter for allocators.
Dhruv Matani
dhruvbird@gmx.net
Mon Jan 26 04:38:00 GMT 2004
On Mon, 2004-01-26 at 07:34, Matt Austern wrote:
> On Jan 22, 2004, at 2:50 AM, Dhruv Matani wrote:
>
> > 4. Does anyone know of an allocator that makes use of the hint
> > parameter
> > for locality preservation?
>
> I don't know of any. There's a chicken-and-egg problem, of course: most
> of the standard containers don't bother to use the hint parameter
> because
> most allocators don't take advantage of it, and most allocators don't
> bother
> to provide this functionality for exactly the same reason.
I can't see any containers doing that in the future too (except for
list), because I guess it wouldn't make much sense too. Again if deque
had a single node (as I have mentioned in my previous mail) then
possibly this could be used? Any idea whether map and multimap would be
able to use it? As I see it now, neither can predict how the rebalance
function will change the tree structure, so it would not make much sense
for them to have a hint parameter.
--
-Dhruv Matani.
http://www.geocities.com/dhruvbird/
More information about the Libstdc++
mailing list