8025550: valgrind: Conditional jump depends on uninitialised value in Arena::set_size_in_bytes()
authorzgu
Mon, 17 Mar 2014 13:39:17 -0400
changeset 23446 a8275418a69e
parent 23445 f01f43f477a1
child 23447 271ad7631939
8025550: valgrind: Conditional jump depends on uninitialised value in Arena::set_size_in_bytes() Summary: Fixed initialized variable that could miscount arena memory Reviewed-by: coleenp, ccheung
hotspot/src/share/vm/memory/allocation.cpp
--- a/hotspot/src/share/vm/memory/allocation.cpp	Sat Mar 15 04:03:42 2014 -0700
+++ b/hotspot/src/share/vm/memory/allocation.cpp	Mon Mar 17 13:39:17 2014 -0400
@@ -446,6 +446,7 @@
   _first = _chunk = new (AllocFailStrategy::EXIT_OOM, init_size) Chunk(init_size);
   _hwm = _chunk->bottom();      // Save the cached hwm, max
   _max = _chunk->top();
+  _size_in_bytes = 0;
   set_size_in_bytes(init_size);
   NOT_PRODUCT(Atomic::inc(&_instance_count);)
 }
@@ -454,6 +455,7 @@
   _first = _chunk = new (AllocFailStrategy::EXIT_OOM, Chunk::init_size) Chunk(Chunk::init_size);
   _hwm = _chunk->bottom();      // Save the cached hwm, max
   _max = _chunk->top();
+  _size_in_bytes = 0;
   set_size_in_bytes(Chunk::init_size);
   NOT_PRODUCT(Atomic::inc(&_instance_count);)
 }