DescriptionShrink weak hash tables when adding elements, if needed.
Hash tables containing weak references tend to be asymmetrically
handled -- Blink "user code" will add elements to the hash table,
with the garbage collector taking care of removing references
to elements that have no other strong references to keep them
alive. The weak processing of hash tables isn't capable of
shrinking and allocate a new hash table backing store while
running, hence the table entries are only cleared.
Blink code will rarely do manual removals from these
collections, which gives the hash table no opportunity
to actually shrink the capacity of the backing store.
This can lead to hash tables with a very low load factor,
the majority of the entries be deleted and empty slots.
To allow for shrinking to happen over hash tables with
weak references, add() will check if shrinking is required.
R=
BUG=
Committed: https://crrev.com/c9eb1766e3fa7c5b221ceca2c30ca402bb204014
Cr-Commit-Position: refs/heads/master@{#397667}
Patch Set 1 #
Total comments: 4
Patch Set 2 : comment typo #Messages
Total messages: 13 (5 generated)
|