Commit 59f073e8 authored by Michael Lippautz's avatar Michael Lippautz Committed by Commit Bot

[oilpan] HashTable: Avoid double registration of callbacks when possible

Bug: chromium:757440
Change-Id: I3b691a2ac8ca9d10a5540fe7385f2278cdef94ec
Reviewed-on: https://chromium-review.googlesource.com/973169
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#545002}
parent 8da8c0ec
......@@ -2110,6 +2110,12 @@ HashTable<Key, Value, Extractor, HashFunctions, Traits, KeyTraits, Allocator>::
// Weak HashTable. The HashTable may be held alive strongly from somewhere
// else, e.g., an iterator.
// Small performance optimization: It is safe to assume that if the enqueued
// flag has been set all callbacks have been previously registered and it is
// safe to bail out.
if (Enqueued())
return;
// Marking of the table is delayed because the backing store is potentially
// held alive strongly by other objects. Delayed marking happens after
// regular marking.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment