diff src/share/vm/utilities/debug.cpp @ 6268:6c5b7a6becc8

7187454: stack overflow in C2 compiler thread on Solaris x86 Summary: Added new FormatBufferResource class to use thread's resource area for error message buffer. Reviewed-by: twisti
author kvn
date Mon, 30 Jul 2012 09:49:25 -0700
parents 09d00c18e323
children da91efe96a93
line wrap: on
line diff
--- a/src/share/vm/utilities/debug.cpp	Fri Jul 27 16:14:15 2012 -0700
+++ b/src/share/vm/utilities/debug.cpp	Mon Jul 30 09:49:25 2012 -0700
@@ -91,6 +91,13 @@
 #  endif
 #endif // PRODUCT
 
+FormatBufferResource::FormatBufferResource(const char * format, ...)
+  : FormatBufferBase((char*)resource_allocate_bytes(RES_BUFSZ)) {
+  va_list argp;
+  va_start(argp, format);
+  jio_vsnprintf(_buf, RES_BUFSZ, format, argp);
+  va_end(argp);
+}
 
 void warning(const char* format, ...) {
   if (PrintWarnings) {