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

Unified Diff: runtime/vm/dart_api_state.h

Issue 2762323002: Reimplemented zone memory tracking to avoid race conditions that were causing crashes in the previo… (Closed)
Patch Set: Reimplemented zone memory tracking to avoid race conditions that were causing crashes in the previo… Created 3 years, 9 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: runtime/vm/dart_api_state.h
diff --git a/runtime/vm/dart_api_state.h b/runtime/vm/dart_api_state.h
index 1928ca00a5d827212f4f30e676d2ccbac771358e..a9ae99ce975b6973c1f3a1a2a0278320df6a9a52 100644
--- a/runtime/vm/dart_api_state.h
+++ b/runtime/vm/dart_api_state.h
@@ -676,7 +676,7 @@ class ApiNativeScope {
reinterpret_cast<uword>(this));
// We manually increment the memory usage counter since there is memory
// initially allocated within the zone on creation.
- IncrementNativeScopeMemoryUsage(zone_.GetZone()->CapacityInBytes());
+ IncrementNativeScopeMemoryCapacity(zone_.GetZone()->CapacityInBytes());
}
~ApiNativeScope() {
@@ -685,7 +685,7 @@ class ApiNativeScope {
// We must also manually decrement the memory usage counter since the native
// is still holding it's initial memory and ~Zone() won't be able to
// determine which memory usage counter to decrement.
- DecrementNativeScopeMemoryUsage(zone_.GetZone()->CapacityInBytes());
+ DecrementNativeScopeMemoryCapacity(zone_.GetZone()->CapacityInBytes());
}
static inline ApiNativeScope* Current() {
@@ -695,11 +695,11 @@ class ApiNativeScope {
static intptr_t current_memory_usage() { return current_memory_usage_; }
- static void IncrementNativeScopeMemoryUsage(intptr_t size) {
+ static void IncrementNativeScopeMemoryCapacity(intptr_t size) {
AtomicOperations::IncrementBy(&current_memory_usage_, size);
}
- static void DecrementNativeScopeMemoryUsage(intptr_t size) {
+ static void DecrementNativeScopeMemoryCapacity(intptr_t size) {
AtomicOperations::DecrementBy(&current_memory_usage_, size);
}

Powered by Google App Engine
This is Rietveld 408576698