< prev index next >

src/share/vm/utilities/vmError.cpp

Print this page
rev 9831 : 8146905 - cleanup ostream, staticBufferStream
Summary: get rid of staticBufferStream and implement the use-caller-provided-scratch-buffer feature in a simpler way.

@@ -1092,10 +1092,12 @@
                              Thread* thread, address pc, void* siginfo, void* context, const char* filename,
                              int lineno, size_t size)
 {
   // Don't allocate large buffer on stack
   static char buffer[O_BUFLEN];
+  out.set_scratch_buffer(buffer, sizeof(buffer));
+  log.set_scratch_buffer(buffer, sizeof(buffer));
 
   // How many errors occurred in error handler when reporting first_error.
   static int recursive_error_count;
 
   // We will first print a brief message to standard out (verbose = false),

@@ -1178,12 +1180,11 @@
     }
   }
 
   // print to screen
   if (!out_done) {
-    staticBufferStream sbs(buffer, sizeof(buffer), &out);
-    report(&sbs, false);
+    report(&out, false);
 
     out_done = true;
 
     _current_step = 0;
     _current_step_info = "";

@@ -1207,12 +1208,11 @@
          * Maybe implement direct streaming in the future.*/
         transmit_report_done = true;
       }
     }
 
-    staticBufferStream sbs(buffer, O_BUFLEN, &log);
-    report(&sbs, true);
+    report(&log, true);
     _current_step = 0;
     _current_step_info = "";
 
     // Run error reporting to determine whether or not to report the crash.
     if (!transmit_report_done && should_report_bug(_id)) {
< prev index next >