< prev index next >

src/hotspot/share/memory/allocation.inline.hpp

Print this page
rev 55678 : 8227597: [fastdbg build] Arena::inc_bytes_allocated should get inlined
Reviewed-by: mbaesken, goetz

*** 32,51 **** #include "utilities/globalDefinitions.hpp" // Explicit C-heap memory management #ifndef PRODUCT ! // Increments unsigned long value for statistics (not atomic on MP). inline void inc_stat_counter(volatile julong* dest, julong add_value) { ! #if defined(SPARC) || defined(X86) ! // Sparc and X86 have atomic jlong (8 bytes) instructions ! julong value = Atomic::load(dest); ! value += add_value; ! Atomic::store(value, dest); ! #else ! // possible word-tearing during load/store *dest += add_value; #endif } #endif template <class E> --- 32,48 ---- #include "utilities/globalDefinitions.hpp" // Explicit C-heap memory management #ifndef PRODUCT ! // Increments unsigned long value for statistics (not atomic on MP, but avoids word-tearing on 32 bit). inline void inc_stat_counter(volatile julong* dest, julong add_value) { ! #ifdef _LP64 *dest += add_value; + #else + julong value = Atomic::load(dest); + Atomic::store(value + add_value, dest); #endif } #endif template <class E>
< prev index next >