hotspot/src/share/vm/utilities/ostream.cpp
changeset 18928 ac0163dd0a50
parent 15803 9328492899cc
child 20010 c66a7254680c
child 19968 64f9d23af647
child 22827 07d991d45a51
--- a/hotspot/src/share/vm/utilities/ostream.cpp	Tue Jul 09 22:48:52 2013 +0200
+++ b/hotspot/src/share/vm/utilities/ostream.cpp	Wed Jul 10 15:49:15 2013 +0000
@@ -296,6 +296,7 @@
   buffer        = NEW_RESOURCE_ARRAY(char, buffer_length);
   buffer_pos    = 0;
   buffer_fixed  = false;
+  DEBUG_ONLY(rm = Thread::current()->current_resource_mark();)
 }
 
 // useful for output to fixed chunks of memory, such as performance counters
@@ -321,6 +322,8 @@
         end = buffer_length * 2;
       }
       char* oldbuf = buffer;
+      assert(rm == NULL || Thread::current()->current_resource_mark() == rm,
+             "stringStream is re-allocated with a different ResourceMark");
       buffer = NEW_RESOURCE_ARRAY(char, end);
       strncpy(buffer, oldbuf, buffer_pos);
       buffer_length = end;