• Clemens Backes's avatar
    [utils] Fix new length computation when growing BitVector · 8cd5d85d
    Clemens Backes authored
    The {std::min} followed by a loop does ensure that the new length is
    bigger than {needed_value}, but does not ensure that we always allocate
    at least {kInitialLength}. Maybe this was intended to be {std::max}?
    
    Anyway, this CL replaces the loop by a computation which ensures that we
    allocate a power of two that is greater than {needed_value} and at least
    {kInitialLength}.
    It also adds a CHECK to guard against integer overflows.
    
    R=jkummerow@chromium.org
    
    Bug: v8:13063
    Change-Id: I374d304204a499536643a6c5df7111231d41d4bd
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3760674Reviewed-by: 's avatarJakob Kummerow <jkummerow@chromium.org>
    Commit-Queue: Clemens Backes <clemensb@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#81724}
    8cd5d85d
Name
Last commit
Last update
..
DIR_METADATA Loading commit data...
OWNERS Loading commit data...
address-map.cc Loading commit data...
address-map.h Loading commit data...
allocation.cc Loading commit data...
allocation.h Loading commit data...
bit-vector.cc Loading commit data...
bit-vector.h Loading commit data...
boxed-float.h Loading commit data...
detachable-vector.cc Loading commit data...
detachable-vector.h Loading commit data...
hex-format.cc Loading commit data...
hex-format.h Loading commit data...
identity-map.cc Loading commit data...
identity-map.h Loading commit data...
locked-queue-inl.h Loading commit data...
locked-queue.h Loading commit data...
memcopy.cc Loading commit data...
memcopy.h Loading commit data...
ostreams.cc Loading commit data...
ostreams.h Loading commit data...
scoped-list.h Loading commit data...
sha-256.cc Loading commit data...
sha-256.h Loading commit data...
sparse-bit-vector.h Loading commit data...
utils-inl.h Loading commit data...
utils.cc Loading commit data...
utils.h Loading commit data...
v8dll-main.cc Loading commit data...
version.cc Loading commit data...
version.h Loading commit data...