Subzero: Improve the behavior of resizing vectors.

In some cases, Subzero needs to insert into a std::vector at a particular index, resizing the vector as necessary.  It appears that our vector implementation sets the capacity to exactly the size when growing the vector, without leaving any extra capacity.  This causes lots of mallocs and recopies each time the vector size is increased.  (Adding elements via push_back() or emplace_back() doesn't seem to have that behavior.)

We help this by reserving some extra space before resizing - bump to the next power of 2 up to some point, then bump to the next multiple of a chunk size beyond that point.

BUG= https://bugs.chromium.org/p/nativeclient/issues/detail?id=4360
R=kschimpf@google.com

Review URL: https://codereview.chromium.org/1783113002 .
4 files changed