diff options
author | Ian Rogers <irogers@google.com> | 2013-11-19 18:00:50 -0800 |
---|---|---|
committer | Ian Rogers <irogers@google.com> | 2013-12-20 08:01:57 -0800 |
commit | b122a4bbed34ab22b4c1541ee25e5cf22f12a926 (patch) | |
tree | 624f16271f4481a8fd5aa2f607385f490dc7b3ae /runtime/gc/heap-inl.h | |
parent | e40687d053b89c495b6fbeb7a766b01c9c7e039c (diff) | |
download | art-b122a4bbed34ab22b4c1541ee25e5cf22f12a926.zip art-b122a4bbed34ab22b4c1541ee25e5cf22f12a926.tar.gz art-b122a4bbed34ab22b4c1541ee25e5cf22f12a926.tar.bz2 |
Tidy up memory barriers.
Change-Id: I937ea93e6df1835ecfe2d4bb7d84c24fe7fc097b
Diffstat (limited to 'runtime/gc/heap-inl.h')
-rw-r--r-- | runtime/gc/heap-inl.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/runtime/gc/heap-inl.h b/runtime/gc/heap-inl.h index 9fb5760..af1b26b 100644 --- a/runtime/gc/heap-inl.h +++ b/runtime/gc/heap-inl.h @@ -61,7 +61,7 @@ inline mirror::Object* Heap::AllocObjectWithAllocator(Thread* self, mirror::Clas pre_fence_visitor(obj); DCHECK_GT(bytes_allocated, 0u); const size_t new_num_bytes_allocated = - static_cast<size_t>(num_bytes_allocated_.fetch_add(bytes_allocated)) + bytes_allocated; + static_cast<size_t>(num_bytes_allocated_.FetchAndAdd(bytes_allocated)) + bytes_allocated; // TODO: Deprecate. if (kInstrumented) { if (Runtime::Current()->HasStatsEnabled()) { @@ -200,7 +200,7 @@ inline Heap::AllocationTimer::~AllocationTimer() { // Only if the allocation succeeded, record the time. if (allocated_obj != nullptr) { uint64_t allocation_end_time = NanoTime() / kTimeAdjust; - heap_->total_allocation_time_.fetch_add(allocation_end_time - allocation_start_time_); + heap_->total_allocation_time_.FetchAndAdd(allocation_end_time - allocation_start_time_); } } }; |