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

Unified Diff: src/heap/spaces.cc

Issue 2390743005: [heap] Concurrently free empty slot set buckets. (Closed)
Patch Set: 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
Index: src/heap/spaces.cc
diff --git a/src/heap/spaces.cc b/src/heap/spaces.cc
index daaf9ad0a0636ef463421d854497bc84687d2eec..a2cb0ea5385bf177cdbdcfc5c1b8034008e4d9a3 100644
--- a/src/heap/spaces.cc
+++ b/src/heap/spaces.cc
@@ -508,7 +508,7 @@ MemoryChunk* MemoryChunk::Initialize(Heap* heap, Address base, size_t size,
chunk->flags_ = Flags(NO_FLAGS);
chunk->set_owner(owner);
chunk->InitializeReservedMemory();
- chunk->old_to_new_slots_ = nullptr;
+ chunk->old_to_new_slots_.SetValue(nullptr);
chunk->old_to_old_slots_ = nullptr;
chunk->typed_old_to_new_slots_.SetValue(nullptr);
chunk->typed_old_to_old_slots_ = nullptr;
@@ -1075,7 +1075,7 @@ void MemoryChunk::ReleaseAllocatedMemory() {
delete mutex_;
mutex_ = nullptr;
}
- if (old_to_new_slots_ != nullptr) ReleaseOldToNewSlots();
+ if (old_to_new_slots_.Value() != nullptr) ReleaseOldToNewSlots();
if (old_to_old_slots_ != nullptr) ReleaseOldToOldSlots();
if (typed_old_to_new_slots_.Value() != nullptr) ReleaseTypedOldToNewSlots();
if (typed_old_to_old_slots_ != nullptr) ReleaseTypedOldToOldSlots();
@@ -1093,13 +1093,14 @@ static SlotSet* AllocateSlotSet(size_t size, Address page_start) {
}
void MemoryChunk::AllocateOldToNewSlots() {
- DCHECK(nullptr == old_to_new_slots_);
- old_to_new_slots_ = AllocateSlotSet(size_, address());
+ DCHECK(nullptr == old_to_new_slots_.Value());
+ old_to_new_slots_.SetValue(AllocateSlotSet(size_, address()));
}
void MemoryChunk::ReleaseOldToNewSlots() {
- delete[] old_to_new_slots_;
- old_to_new_slots_ = nullptr;
+ SlotSet* old_to_new_slots = old_to_new_slots_.Value();
+ delete[] old_to_new_slots;
+ old_to_new_slots_.SetValue(nullptr);
}
void MemoryChunk::AllocateOldToOldSlots() {

Powered by Google App Engine
This is Rietveld 408576698