< prev index next >

src/hotspot/share/gc/z/zStat.cpp

Print this page

        

@@ -422,13 +422,13 @@
 
   const uint32_t ncpus = ZCPU::count();
   for (uint32_t i = 0; i < ncpus; i++) {
     ZStatSamplerData* const cpu_data = get_cpu_local<ZStatSamplerData>(i);
     if (cpu_data->_nsamples > 0) {
-      const uint64_t nsamples = Atomic::xchg((uint64_t)0, &cpu_data->_nsamples);
-      const uint64_t sum = Atomic::xchg((uint64_t)0, &cpu_data->_sum);
-      const uint64_t max = Atomic::xchg((uint64_t)0, &cpu_data->_max);
+      const uint64_t nsamples = Atomic::xchg(&cpu_data->_nsamples, (uint64_t)0);
+      const uint64_t sum = Atomic::xchg(&cpu_data->_sum, (uint64_t)0);
+      const uint64_t max = Atomic::xchg(&cpu_data->_max, (uint64_t)0);
       all._nsamples += nsamples;
       all._sum += sum;
       if (all._max < max) {
         all._max = max;
       }

@@ -457,11 +457,11 @@
   uint64_t counter = 0;
 
   const uint32_t ncpus = ZCPU::count();
   for (uint32_t i = 0; i < ncpus; i++) {
     ZStatCounterData* const cpu_data = get_cpu_local<ZStatCounterData>(i);
-    counter += Atomic::xchg((uint64_t)0, &cpu_data->_counter);
+    counter += Atomic::xchg(&cpu_data->_counter, (uint64_t)0);
   }
 
   ZStatSample(_sampler, counter);
 }
 

@@ -479,11 +479,11 @@
   ZStatCounterData all;
 
   const uint32_t ncpus = ZCPU::count();
   for (uint32_t i = 0; i < ncpus; i++) {
     ZStatCounterData* const cpu_data = get_cpu_local<ZStatCounterData>(i);
-    all._counter += Atomic::xchg((uint64_t)0, &cpu_data->_counter);
+    all._counter += Atomic::xchg(&cpu_data->_counter, (uint64_t)0);
   }
 
   return all;
 }
 
< prev index next >