Index: runtime/vm/weak_table.cc |
diff --git a/runtime/vm/weak_table.cc b/runtime/vm/weak_table.cc |
index cb45d2ec5a89f5f649f6b6eb78cd5834e93b4c71..e45e9c8c86be9a117b57ecaea5062cadff466c84 100644 |
--- a/runtime/vm/weak_table.cc |
+++ b/runtime/vm/weak_table.cc |
@@ -75,6 +75,16 @@ void WeakTable::SetValue(RawObject* key, intptr_t val) { |
} |
+void WeakTable::Reset() { |
+ intptr_t* old_data = data_; |
+ used_ = 0; |
+ count_ = 0; |
+ size_ = kMinSize; |
+ data_ = reinterpret_cast<intptr_t*>(calloc(size_, kEntrySize * kWordSize)); |
+ free(old_data); |
+} |
+ |
+ |
void WeakTable::Rehash() { |
intptr_t old_size = size(); |
intptr_t* old_data = data_; |