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

Unified Diff: src/heap/slot-set.h

Issue 2412453003: [heap] RemoveRange of SlotSet should not push nullptr for empty buckets on the pre-free stack. (Closed)
Patch Set: move mutex Created 4 years, 2 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: src/heap/slot-set.h
diff --git a/src/heap/slot-set.h b/src/heap/slot-set.h
index 5616bc8778518d6a4f2930dff456f95208823b6b..578eb42d1f7e645a8d1403f0862bc6e9bd8bfa18 100644
--- a/src/heap/slot-set.h
+++ b/src/heap/slot-set.h
@@ -81,10 +81,12 @@ class SlotSet : public Malloced {
}
void PreFreeEmptyBucket(int bucket_index) {
- base::LockGuard<base::Mutex> guard(&to_be_freed_buckets_mutex_);
base::AtomicValue<uint32_t>* bucket_ptr = bucket[bucket_index].Value();
- to_be_freed_buckets_.push(bucket_ptr);
- bucket[bucket_index].SetValue(nullptr);
+ if (bucket_ptr != nullptr) {
+ base::LockGuard<base::Mutex> guard(&to_be_freed_buckets_mutex_);
+ to_be_freed_buckets_.push(bucket_ptr);
+ bucket[bucket_index].SetValue(nullptr);
+ }
}
// The slot offsets specify a range of slots at addresses:
« 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