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

Unified Diff: runtime/vm/pages.cc

Issue 1658983004: Change signature of atomic increment/decrement functions to return void. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: 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 | « runtime/vm/atomic_win.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/pages.cc
diff --git a/runtime/vm/pages.cc b/runtime/vm/pages.cc
index efa0a4670378ae92e1d3567a05b86da52a4ff024..514690d2cb67c46895f2fc0df2df29fed07ce336 100644
--- a/runtime/vm/pages.cc
+++ b/runtime/vm/pages.cc
@@ -346,8 +346,8 @@ uword PageSpace::TryAllocateInFreshPage(intptr_t size,
// Start of the newly allocated page is the allocated object.
result = page->object_start();
// Note: usage_.capacity_in_words is increased by AllocatePage.
- AtomicOperations::FetchAndIncrementBy(&(usage_.used_in_words),
- (size >> kWordSizeLog2));
+ AtomicOperations::IncrementBy(&(usage_.used_in_words),
+ (size >> kWordSizeLog2));
// Enqueue the remainder in the free list.
uword free_start = result + size;
intptr_t free_size = page->object_end() - free_start;
@@ -384,8 +384,8 @@ uword PageSpace::TryAllocateInternal(intptr_t size,
result = TryAllocateInFreshPage(size, type, growth_policy, is_locked);
// usage_ is updated by the call above.
} else {
- AtomicOperations::FetchAndIncrementBy(&(usage_.used_in_words),
- (size >> kWordSizeLog2));
+ AtomicOperations::IncrementBy(&(usage_.used_in_words),
+ (size >> kWordSizeLog2));
}
} else {
// Large page allocation.
@@ -404,8 +404,8 @@ uword PageSpace::TryAllocateInternal(intptr_t size,
if (page != NULL) {
result = page->object_start();
// Note: usage_.capacity_in_words is increased by AllocateLargePage.
- AtomicOperations::FetchAndIncrementBy(&(usage_.used_in_words),
- (size >> kWordSizeLog2));
+ AtomicOperations::IncrementBy(&(usage_.used_in_words),
+ (size >> kWordSizeLog2));
}
}
}
@@ -434,16 +434,14 @@ uword PageSpace::TryAllocateInternal(intptr_t size,
void PageSpace::AllocateExternal(intptr_t size) {
intptr_t size_in_words = size >> kWordSizeLog2;
- AtomicOperations::FetchAndIncrementBy(&(usage_.external_in_words),
- size_in_words);
+ AtomicOperations::IncrementBy(&(usage_.external_in_words), size_in_words);
// TODO(koda): Control growth.
}
void PageSpace::FreeExternal(intptr_t size) {
intptr_t size_in_words = size >> kWordSizeLog2;
- AtomicOperations::FetchAndDecrementBy(&(usage_.external_in_words),
- size_in_words);
+ AtomicOperations::DecrementBy(&(usage_.external_in_words), size_in_words);
}
@@ -1009,8 +1007,8 @@ uword PageSpace::TryAllocateDataBumpInternal(intptr_t size,
ASSERT(remaining >= size);
uword result = bump_top_;
bump_top_ += size;
- AtomicOperations::FetchAndIncrementBy(&(usage_.used_in_words),
- (size >> kWordSizeLog2));
+ AtomicOperations::IncrementBy(&(usage_.used_in_words),
+ (size >> kWordSizeLog2));
// Note: Remaining block is unwalkable until MakeIterable is called.
#ifdef DEBUG
if (bump_top_ < bump_end_) {
@@ -1040,8 +1038,8 @@ uword PageSpace::TryAllocatePromoLocked(intptr_t size,
FreeList* freelist = &freelist_[HeapPage::kData];
uword result = freelist->TryAllocateSmallLocked(size);
if (result != 0) {
- AtomicOperations::FetchAndIncrementBy(&(usage_.used_in_words),
- (size >> kWordSizeLog2));
+ AtomicOperations::IncrementBy(&(usage_.used_in_words),
+ (size >> kWordSizeLog2));
return result;
}
result = TryAllocateDataBumpLocked(size, growth_policy);
« no previous file with comments | « runtime/vm/atomic_win.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698