Commit c1900d3f authored by Omer Katz's avatar Omer Katz Committed by Commit Bot

heap: Resolve data race when getting background marking time stat

Incremental marking queries the background_marking_time statistic when
it evaluates progress. The concurrent marker can update the statistic
at the same time. Querying the statistic needs to be atomic.

Bug: 986235
Change-Id: If69dca913f9ba2dba2d03a27801443248ce8f272
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1893266
Commit-Queue: Omer Katz <omerkatz@chromium.org>
Reviewed-by: default avatarMichael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#711423}
parent dc17007b
...@@ -196,7 +196,7 @@ base::TimeDelta ThreadHeapStatsCollector::Event::foreground_marking_time() ...@@ -196,7 +196,7 @@ base::TimeDelta ThreadHeapStatsCollector::Event::foreground_marking_time()
base::TimeDelta ThreadHeapStatsCollector::Event::background_marking_time() base::TimeDelta ThreadHeapStatsCollector::Event::background_marking_time()
const { const {
return base::TimeDelta::FromMicroseconds( return base::TimeDelta::FromMicroseconds(
concurrent_scope_data[kConcurrentMark]); base::subtle::NoBarrier_Load(&concurrent_scope_data[kConcurrentMark]));
} }
base::TimeDelta ThreadHeapStatsCollector::Event::marking_time() const { base::TimeDelta ThreadHeapStatsCollector::Event::marking_time() const {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment