[webkit-dev] size_t vs unsigned in WTF::Vector API ?

Filip Pizlo fpizlo at apple.com
Thu Nov 20 11:34:26 PST 2014

If there was a benefit, then the following approach would make sense to me:

- Have both Vector and SmallVector.  SmallVector will use unsigned internally.

- Use SmallVector in the places where sizeof(Vector) matters.  This would take some effort but I think that we have the tools that would be needed to be systematic about it.

- Both Vector and SmallVector will have an API based on size_t.  SmallVector will do truncation checks in all of the places.


> On Nov 20, 2014, at 11:32 AM, Geoffrey Garen <ggaren at apple.com> wrote:
>> I wonder what the downsides are to this approach.  Footprint of Vector?
> It looks like the original change was motivated by shrinking Vector:
> 	https://bugs.webkit.org/show_bug.cgi?id=97268 <https://bugs.webkit.org/show_bug.cgi?id=97268>
> Sadly, it didn’t include any data on the observed benefit :(.
> Geoff

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-dev/attachments/20141120/89b9af7a/attachment.html>

More information about the webkit-dev mailing list