< prev index next >

src/hotspot/share/gc/shared/ptrQueue.cpp

Print this page

        

@@ -180,11 +180,11 @@
   // the allocation rate and the release rate are going to be fairly
   // similar, due to how the buffers are used.
   const size_t trigger_transfer = 10;
 
   // Add to pending list. Update count first so no underflow in transfer.
-  size_t pending_count = Atomic::add(1u, &_pending_count);
+  size_t pending_count = Atomic::add(&_pending_count, 1u);
   _pending_list.push(*node);
   if (pending_count > trigger_transfer) {
     try_transfer_pending();
   }
 }

@@ -217,11 +217,11 @@
     // Wait for any in-progress pops, to avoid ABA for them.
     GlobalCounter::write_synchronize();
 
     // Add synchronized nodes to _free_list.
     // Update count first so no underflow in allocate().
-    Atomic::add(count, &_free_count);
+    Atomic::add(&_free_count, count);
     _free_list.prepend(*first, *last);
     log_trace(gc, ptrqueue, freelist)
              ("Transferred %s pending to free: " SIZE_FORMAT, name(), count);
   }
   Atomic::release_store(&_transfer_lock, false);

@@ -256,6 +256,5 @@
 }
 
 void PtrQueueSet::deallocate_buffer(BufferNode* node) {
   _allocator->release(node);
 }
-
< prev index next >