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

Unified Diff: src/zone/accounting-allocator.cc

Issue 2392183004: Added zone pool metrics to gc-trace. (Closed)
Patch Set: Added recent master changes 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 | « src/zone/accounting-allocator.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/zone/accounting-allocator.cc
diff --git a/src/zone/accounting-allocator.cc b/src/zone/accounting-allocator.cc
index 25ccb3090b3cbd5723536193d436c390e31ab6fd..5d6fda163b785844c34b735db331a117bb455c06 100644
--- a/src/zone/accounting-allocator.cc
+++ b/src/zone/accounting-allocator.cc
@@ -84,6 +84,10 @@ size_t AccountingAllocator::GetMaxMemoryUsage() const {
return base::NoBarrier_Load(&max_memory_usage_);
}
+size_t AccountingAllocator::GetCurrentPoolSize() const {
+ return base::NoBarrier_Load(&current_pool_size_);
+}
+
Segment* AccountingAllocator::GetSegmentFromPool(size_t requested_size) {
if (requested_size > (1 << kMaxSegmentSizePower)) {
return nullptr;
@@ -106,7 +110,8 @@ Segment* AccountingAllocator::GetSegmentFromPool(size_t requested_size) {
segment->set_next(nullptr);
unused_segments_sizes[power]--;
- unused_segments_size_ -= segment->size();
+ base::NoBarrier_AtomicIncrement(
+ &current_pool_size_, -static_cast<base::AtomicWord>(segment->size()));
}
}
@@ -139,7 +144,7 @@ bool AccountingAllocator::AddSegmentToPool(Segment* segment) {
segment->set_next(unused_segments_heads_[power]);
unused_segments_heads_[power] = segment;
- unused_segments_size_ += size;
+ base::NoBarrier_AtomicIncrement(&current_pool_size_, size);
unused_segments_sizes[power]++;
}
« no previous file with comments | « src/zone/accounting-allocator.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698