Mercurial > hg > graal-jvmci-8
comparison src/share/vm/utilities/ostream.cpp @ 11173:6b0fd0964b87
Merge with http://hg.openjdk.java.net/hsx/hsx25/hotspot/
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Wed, 31 Jul 2013 11:00:54 +0200 |
parents | b8f261ba79c6 dbc0b5dc08f5 |
children | cefad50507d8 |
comparison
equal
deleted
inserted
replaced
10912:4ea54634f03e | 11173:6b0fd0964b87 |
---|---|
294 stringStream::stringStream(size_t initial_size) : outputStream() { | 294 stringStream::stringStream(size_t initial_size) : outputStream() { |
295 buffer_length = initial_size; | 295 buffer_length = initial_size; |
296 buffer = NEW_RESOURCE_ARRAY(char, buffer_length); | 296 buffer = NEW_RESOURCE_ARRAY(char, buffer_length); |
297 buffer_pos = 0; | 297 buffer_pos = 0; |
298 buffer_fixed = false; | 298 buffer_fixed = false; |
299 DEBUG_ONLY(rm = Thread::current()->current_resource_mark();) | |
299 } | 300 } |
300 | 301 |
301 // useful for output to fixed chunks of memory, such as performance counters | 302 // useful for output to fixed chunks of memory, such as performance counters |
302 stringStream::stringStream(char* fixed_buffer, size_t fixed_buffer_size) : outputStream() { | 303 stringStream::stringStream(char* fixed_buffer, size_t fixed_buffer_size) : outputStream() { |
303 buffer_length = fixed_buffer_size; | 304 buffer_length = fixed_buffer_size; |
319 // increase to the requested size. | 320 // increase to the requested size. |
320 if (end < buffer_length * 2) { | 321 if (end < buffer_length * 2) { |
321 end = buffer_length * 2; | 322 end = buffer_length * 2; |
322 } | 323 } |
323 char* oldbuf = buffer; | 324 char* oldbuf = buffer; |
325 assert(rm == NULL || Thread::current()->current_resource_mark() == rm, | |
326 "stringStream is re-allocated with a different ResourceMark"); | |
324 buffer = NEW_RESOURCE_ARRAY(char, end); | 327 buffer = NEW_RESOURCE_ARRAY(char, end); |
325 strncpy(buffer, oldbuf, buffer_pos); | 328 strncpy(buffer, oldbuf, buffer_pos); |
326 buffer_length = end; | 329 buffer_length = end; |
327 } | 330 } |
328 } | 331 } |