[Patch] Fix __len overflows (take 2)

Paolo Carlini pcarlini@suse.de
Tue Oct 19 21:15:00 GMT 2004


Hi,

the below tries to incorporate to my best Nathan's comments: first,
we check that max_size() will not be exceeded, then, in case __len
overflows, we allocate exactly max_size(). The underlying logic is
that max_size() is the real point of reference wrt the max possible
size of a vector and is supposed to reflect what the system can
really achieve.

I'm finishing testing on x86 and x86_64 and would like to commit
the patch tomorrow if it's fine with everyone...

Paolo.

//////////
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: CL_vector_2
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20041019/d30c5c78/attachment.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: patch_vector_2
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20041019/d30c5c78/attachment-0001.ksh>


More information about the Libstdc++ mailing list