RFC: Hint parameter for allocators.
Gabriel Dos Reis
gdr@integrable-solutions.net
Mon Jan 26 04:11:00 GMT 2004
Matt Austern <austern@apple.com> writes:
| 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 had meant to submit a patch that makes uses of the hint parameter,
especially for vector<>::resize -- especially to make it avoid
excessive copies when the "native" allocator is used.
I lost that patch when my laptop was stolen three weeks ago.
(Also, it had a potiential for an ABI change).
-- Gaby
More information about the Libstdc++
mailing list