changeset 23446:a8275418a69e

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
author zgu
date Mon, 17 Mar 2014 13:39:17 -0400
parents f01f43f477a1
children 271ad7631939
files hotspot/src/share/vm/memory/allocation.cpp
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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);)
 }