comparison 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
comparison
equal deleted inserted replaced
6267:977007096840 6268:6c5b7a6becc8
89 # if -defined _DEBUG || -defined ASSERT 89 # if -defined _DEBUG || -defined ASSERT
90 configuration error: ASSERT et al. must not be defined in PRODUCT version 90 configuration error: ASSERT et al. must not be defined in PRODUCT version
91 # endif 91 # endif
92 #endif // PRODUCT 92 #endif // PRODUCT
93 93
94 FormatBufferResource::FormatBufferResource(const char * format, ...)
95 : FormatBufferBase((char*)resource_allocate_bytes(RES_BUFSZ)) {
96 va_list argp;
97 va_start(argp, format);
98 jio_vsnprintf(_buf, RES_BUFSZ, format, argp);
99 va_end(argp);
100 }
94 101
95 void warning(const char* format, ...) { 102 void warning(const char* format, ...) {
96 if (PrintWarnings) { 103 if (PrintWarnings) {
97 // In case error happens before init or during shutdown 104 // In case error happens before init or during shutdown
98 if (tty == NULL) ostream_init(); 105 if (tty == NULL) ostream_init();