comparison src/share/vm/utilities/debug.hpp @ 2361:1216415d8e35

7014923: G1: code cleanup Summary: Some G1 code cleanup. Reviewed-by: johnc, jcoomes, jwilhelm
author tonyp
date Fri, 04 Mar 2011 17:13:19 -0500
parents 3582bf76420e
children 1d1603768966
comparison
equal deleted inserted replaced
2312:11303bede852 2361:1216415d8e35
23 */ 23 */
24 24
25 #ifndef SHARE_VM_UTILITIES_DEBUG_HPP 25 #ifndef SHARE_VM_UTILITIES_DEBUG_HPP
26 #define SHARE_VM_UTILITIES_DEBUG_HPP 26 #define SHARE_VM_UTILITIES_DEBUG_HPP
27 27
28 #include "prims/jvm.h"
28 #include "utilities/globalDefinitions.hpp" 29 #include "utilities/globalDefinitions.hpp"
29 30
30 #include <stdarg.h> 31 #include <stdarg.h>
31 32
32 // Simple class to format the ctor arguments into a fixed-sized buffer. 33 // Simple class to format the ctor arguments into a fixed-sized buffer.
46 47
47 template <size_t bufsz> 48 template <size_t bufsz>
48 FormatBuffer<bufsz>::FormatBuffer(const char * format, ...) { 49 FormatBuffer<bufsz>::FormatBuffer(const char * format, ...) {
49 va_list argp; 50 va_list argp;
50 va_start(argp, format); 51 va_start(argp, format);
51 vsnprintf(_buf, bufsz, format, argp); 52 jio_vsnprintf(_buf, bufsz, format, argp);
52 va_end(argp); 53 va_end(argp);
53 } 54 }
54 55
55 template <size_t bufsz> 56 template <size_t bufsz>
56 void FormatBuffer<bufsz>::append(const char* format, ...) { 57 void FormatBuffer<bufsz>::append(const char* format, ...) {
59 size_t len = strlen(_buf); 60 size_t len = strlen(_buf);
60 char* buf_end = _buf + len; 61 char* buf_end = _buf + len;
61 62
62 va_list argp; 63 va_list argp;
63 va_start(argp, format); 64 va_start(argp, format);
64 vsnprintf(buf_end, bufsz - len, format, argp); 65 jio_vsnprintf(buf_end, bufsz - len, format, argp);
65 va_end(argp); 66 va_end(argp);
66 } 67 }
67 68
68 // Used to format messages for assert(), guarantee(), fatal(), etc. 69 // Used to format messages for assert(), guarantee(), fatal(), etc.
69 typedef FormatBuffer<> err_msg; 70 typedef FormatBuffer<> err_msg;