Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(332)

Unified Diff: third_party/WebKit/Source/platform/wtf/HashTable.h

Issue 2815663002: Disable collection backing reallocation during pre finalizer (Closed)
Patch Set: fix Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/platform/wtf/HashTable.h
diff --git a/third_party/WebKit/Source/platform/wtf/HashTable.h b/third_party/WebKit/Source/platform/wtf/HashTable.h
index 0907c7420f897798365749fadea97240eb6041d2..17eb2512571fcba5401b2514c24e4129539fac6d 100644
--- a/third_party/WebKit/Source/platform/wtf/HashTable.h
+++ b/third_party/WebKit/Source/platform/wtf/HashTable.h
@@ -836,6 +836,7 @@ class HashTable final
// expensive.
return key_count_ * kMinLoad < table_size_ &&
table_size_ > KeyTraits::kMinimumTableSize &&
+ Allocator::IsBackingReallocationAllowed() &&
Allocator::IsAllocationAllowed();
haraken 2017/04/12 06:44:34 Do you know what the IsAllocationAllowed check is
keishi 2017/04/12 09:43:53 Used IsAllocationAllowed instead of adding a new f
}
ValueType* Expand(ValueType* entry = 0);
@@ -1230,6 +1231,7 @@ typename HashTable<Key,
Allocator>::AddResult
HashTable<Key, Value, Extractor, HashFunctions, Traits, KeyTraits, Allocator>::
insert(T&& key, Extra&& extra) {
+ DCHECK(Allocator::IsBackingReallocationAllowed());
DCHECK(!AccessForbidden());
DCHECK(Allocator::IsAllocationAllowed());
if (!table_)
@@ -1616,6 +1618,7 @@ template <typename Key,
Value*
HashTable<Key, Value, Extractor, HashFunctions, Traits, KeyTraits, Allocator>::
Expand(Value* entry) {
+ DCHECK(Allocator::IsBackingReallocationAllowed());
unsigned new_size;
if (!table_size_) {
new_size = KeyTraits::kMinimumTableSize;

Powered by Google App Engine
This is Rietveld 408576698