vector<> can probably never grow to it's maximum size!

Paolo Carlini pcarlini@suse.de
Mon Oct 18 15:28:00 GMT 2004


Paolo Carlini wrote:

> Therefore, mt_alloc either issues to the OS a *very* small memory 
> request - to
> refill one of its pools, of order 4K - or just returns what ::operator 
> new returns.
> In low memory, only the latter requests are problematic,

Forgot to add: even supposing that we want to deal gracefully with these
::operator new throws (pool_allocator is able to do that), in such 
cases, vector
is actually requesting only an handful of bytes, typically cannot really 
keep on
working if allocator::allocate returns less. This is *not* the situation 
that you
presented at the outset, in any case.

Paolo.



More information about the Libstdc++ mailing list