RFC: Hint parameter for allocators.

Dhruv Matani dhruvbird@gmx.net
Mon Jan 26 07:59:00 GMT 2004


On Mon, 2004-01-26 at 09:34, Gabriel Dos Reis wrote:
[...]

> 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). 

I went through the posts on c.lang.c++.m once again, and the
infrastructure for using the extension seems to be pretty flawless from
a vector's perspective. On the other hand, I did not find any mention
about how an implementation may provide the __resize_storage function.
Do you have any plans for how it may be done on say my GNU/Linux system.
AFAIK, my version of the kernel (2.4) and the assiciated GLibc ship with
Doug Lea's malloc, which would resort to mmap most of the time when the
vector requests for more memory. Unless the vector is currently asking
for < 128 Bytes, internal free lists will be used by malloc, which again
have no scope for expanding.



-- 
	-Dhruv Matani.
http://www.geocities.com/dhruvbird/





More information about the Libstdc++ mailing list