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

Unified Diff: Source/wtf/HashTable.h

Issue 180273022: Don't deallocate the HashTable backing explicitly when it is managed by GC. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: address nit Created 6 years, 10 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/wtf/HashTable.h
diff --git a/Source/wtf/HashTable.h b/Source/wtf/HashTable.h
index 1289ad48d6c4be60639102583a9b3161c093c0db..30c8bbd5ef55f94a0169bbea561c132d835d5fcd 100644
--- a/Source/wtf/HashTable.h
+++ b/Source/wtf/HashTable.h
@@ -280,6 +280,8 @@ namespace WTF {
HashTable();
~HashTable()
{
+ if (Allocator::isGarbageCollected)
+ return;
if (LIKELY(!m_table))
return;
deallocateTable(m_table, m_tableSize);
@@ -887,6 +889,8 @@ namespace WTF {
template<typename Key, typename Value, typename Extractor, typename HashFunctions, typename Traits, typename KeyTraits, typename Allocator>
void HashTable<Key, Value, Extractor, HashFunctions, Traits, KeyTraits, Allocator>::deallocateTable(ValueType* table, unsigned size)
{
+ if (Allocator::isGarbageCollected)
+ return;
if (Traits::needsDestruction) {
for (unsigned i = 0; i < size; ++i) {
if (!isDeletedBucket(table[i]))
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698