This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: vector<> can probably never grow to it's maximum size!
Dhruv Matani wrote:
And tries to explain more concretely what I'm trying to achieve and also
shows that it's do able in current C++.
Why you keep on refusing to deal with one issue at a time?
The below cannot fix, not even in principle, the immediate problem that
we have with __len overflowing size_type: all the new tricks in __mt_alloc
are not in effect in this case, ::operator new for sure will never return
an address == _M_start (half the memory is already used), it will always
throw, even if you ask only for __old_size + 1. Don't try to achieve the
impossible, concentrate on the case of small memory allocations, managed
via mt_alloc memory pools: in that case there is rooom for improvement..
Paolo.