[vm] Avoid data race querying the new-space page cache.

This access is extremely infrequent, so we may as well consistently use the mutex.

TEST=tsan
Bug: https://github.com/dart-lang/sdk/issues/45521
Change-Id: I17b276f671e20c2eed8bf26735cc11c386fba9e6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194013
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
This commit is contained in:
Ryan Macnak
2021-04-05 22:48:16 +00:00
committed by commit-bot@chromium.org
parent 06729f230a
commit ee3a86d8ab
+1
View File
@@ -670,6 +670,7 @@ void SemiSpace::Cleanup() {
}
intptr_t SemiSpace::CachedSize() {
MutexLocker ml(page_cache_mutex);
return page_cache_size * kNewPageSize;
}