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

Unified Diff: runtime/vm/atomic.h

Issue 1580813003: Use atomic operations to increment/decrement memory usage counts as multiple threads could be alloc… (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: self-code-review Created 4 years, 11 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 | « no previous file | runtime/vm/atomic_android.h » ('j') | runtime/vm/pages.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/atomic.h
diff --git a/runtime/vm/atomic.h b/runtime/vm/atomic.h
index 809548a3c38933453dc7c5d92db2d06076cbe89d..59a45ace74cc42b1d22c7bc6ee4aad92cb9542c5 100644
--- a/runtime/vm/atomic.h
+++ b/runtime/vm/atomic.h
@@ -18,15 +18,17 @@ class AtomicOperations : public AllStatic {
// Returns the original value at p.
//
// NOTE: Not to be used for any atomic operations involving memory locations
- // that are accessed by generated code
+ // that are accessed by generated code.
static uintptr_t FetchAndIncrement(uintptr_t* p);
+ static uintptr_t FetchAndIncrementBy(intptr_t* p, intptr_t value);
// Atomically fetch the value at p and decrement the value at p.
// Returns the original value at p.
//
// NOTE: Not to be used for any atomic operations involving memory locations
- // that are accessed by generated code
+ // that are accessed by generated code.
static uintptr_t FetchAndDecrement(uintptr_t* p);
+ static uintptr_t FetchAndDecrementBy(intptr_t* p, intptr_t value);
// Atomically compare *ptr to old_value, and if equal, store new_value.
// Returns the original value at ptr.
« no previous file with comments | « no previous file | runtime/vm/atomic_android.h » ('j') | runtime/vm/pages.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698