< prev index next >

src/hotspot/share/gc/g1/g1BlockOffsetTable.hpp

Print this page
rev 55196 : 8225716: G1 GC: Undefined behaviour in G1BlockOffsetTablePart::block_at_or_preceding
Reviewed-by: duke

@@ -63,11 +63,11 @@
   // Bounds checking accessors:
   // For performance these have to devolve to array accesses in product builds.
   inline u_char offset_array(size_t index) const;
 
   void set_offset_array_raw(size_t index, u_char offset) {
-    _offset_array[index] = offset;
+    Atomic::store(offset, &_offset_array[index]);
   }
 
   inline void set_offset_array(size_t index, u_char offset);
 
   inline void set_offset_array(size_t index, HeapWord* high, HeapWord* low);
< prev index next >