< prev index next >

src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp

Print this page

        

@@ -618,11 +618,11 @@
   assert_heaplock_or_safepoint();
   _committed -= bytes;
 }
 
 void ShenandoahHeap::increase_used(size_t bytes) {
-  Atomic::add(bytes, &_used);
+  Atomic::add(&_used, bytes);
 }
 
 void ShenandoahHeap::set_used(size_t bytes) {
   Atomic::release_store_fence(&_used, bytes);
 }

@@ -631,11 +631,11 @@
   assert(used() >= bytes, "never decrease heap size by more than we've left");
   Atomic::sub(bytes, &_used);
 }
 
 void ShenandoahHeap::increase_allocated(size_t bytes) {
-  Atomic::add(bytes, &_bytes_allocated_since_gc_start);
+  Atomic::add(&_bytes_allocated_since_gc_start, bytes);
 }
 
 void ShenandoahHeap::notify_mutator_alloc_words(size_t words, bool waste) {
   size_t bytes = words * HeapWordSize;
   if (!waste) {

@@ -1348,11 +1348,11 @@
   void work(uint worker_id) {
     size_t stride = ShenandoahParallelRegionStride;
 
     size_t max = _heap->num_regions();
     while (_index < max) {
-      size_t cur = Atomic::add(stride, &_index) - stride;
+      size_t cur = Atomic::add(&_index, stride) - stride;
       size_t start = cur;
       size_t end = MIN2(cur + stride, max);
       if (start >= max) break;
 
       for (size_t i = cur; i < end; i++) {
< prev index next >