< prev index next >

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

Print this page

        

@@ -147,11 +147,11 @@
   int new_value = Atomic::add(&_refcount, 1);
   assert(new_value >= 1, "negative refcount %d", new_value - 1);
 }
 
 bool OopStorage::ActiveArray::decrement_refcount() const {
-  int new_value = Atomic::sub(1, &_refcount);
+  int new_value = Atomic::sub(&_refcount, 1);
   assert(new_value >= 0, "negative refcount %d", new_value);
   return new_value == 0;
 }
 
 bool OopStorage::ActiveArray::push(Block* block) {

@@ -722,11 +722,11 @@
       releasing |= entry_bitmask;
       ++count;
     }
     // Release the contiguous entries that are in block.
     block->release_entries(releasing, this);
-    Atomic::sub(count, &_allocation_count);
+    Atomic::sub(&_allocation_count, count);
   }
 }
 
 const size_t initial_active_array_size = 8;
 
< prev index next >