Index: src/heap/spaces.cc |
diff --git a/src/heap/spaces.cc b/src/heap/spaces.cc |
index 9d5ac8ca4a46ecc7c88d0a066277952659e9ebe3..c3c418eccadbee3926918a40a448c285aac83bae 100644 |
--- a/src/heap/spaces.cc |
+++ b/src/heap/spaces.cc |
@@ -398,8 +398,11 @@ bool MemoryAllocator::CanFreeMemoryChunk(MemoryChunk* chunk) { |
// We cannot free memory chunks in new space while the sweeper is running |
// since a sweeper thread might be stuck right before trying to lock the |
// corresponding page. |
+ |
+ // Chunks in old generation are unmapped if they are empty. |
+ DCHECK(chunk->InNewSpace() || chunk->SweepingDone()); |
return !chunk->InNewSpace() || (mc == nullptr) || !FLAG_concurrent_sweeping || |
- mc->sweeper().IsSweepingCompleted(); |
+ chunk->SweepingDone(); |
Michael Lippautz
2016/10/18 16:02:39
I think (mc == nullptr) can go.
ulan
2016/10/18 16:07:05
Done.
|
} |
bool MemoryAllocator::CommitMemory(Address base, size_t size, |