< prev index next >

src/share/vm/utilities/debug.hpp

Print this page

        

*** 34,58 **** class FormatBufferBase { protected: char* _buf; inline FormatBufferBase(char* buf) : _buf(buf) {} public: operator const char *() const { return _buf; } }; // Use resource area for buffer - #define BUFSZ 256 class FormatBufferResource : public FormatBufferBase { public: FormatBufferResource(const char * format, ...) ATTRIBUTE_PRINTF(2, 3); }; // Use stack for buffer ! template <size_t bufsz = BUFSZ> class FormatBuffer : public FormatBufferBase { public: ! inline FormatBuffer(const char * format, ...) ATTRIBUTE_PRINTF(2, 3); inline void append(const char* format, ...) ATTRIBUTE_PRINTF(2, 3); inline void print(const char* format, ...) ATTRIBUTE_PRINTF(2, 3); inline void printv(const char* format, va_list ap) ATTRIBUTE_PRINTF(2, 0); char* buffer() { return _buf; } --- 34,58 ---- class FormatBufferBase { protected: char* _buf; inline FormatBufferBase(char* buf) : _buf(buf) {} public: + static const int BufferSize = 256; operator const char *() const { return _buf; } }; // Use resource area for buffer class FormatBufferResource : public FormatBufferBase { public: FormatBufferResource(const char * format, ...) ATTRIBUTE_PRINTF(2, 3); }; // Use stack for buffer ! template <size_t bufsz = FormatBufferBase::BufferSize> class FormatBuffer : public FormatBufferBase { public: ! inline FormatBuffer(const char* format, ...) ATTRIBUTE_PRINTF(2, 3); inline void append(const char* format, ...) ATTRIBUTE_PRINTF(2, 3); inline void print(const char* format, ...) ATTRIBUTE_PRINTF(2, 3); inline void printv(const char* format, va_list ap) ATTRIBUTE_PRINTF(2, 0); char* buffer() { return _buf; }
*** 103,113 **** va_start(argp, format); jio_vsnprintf(buf_end, bufsz - len, format, argp); va_end(argp); } ! // Used to format messages typedef FormatBuffer<> err_msg; // assertions #ifndef ASSERT #define vmassert(p, ...) --- 103,113 ---- va_start(argp, format); jio_vsnprintf(buf_end, bufsz - len, format, argp); va_end(argp); } ! // Used to format messages. typedef FormatBuffer<> err_msg; // assertions #ifndef ASSERT #define vmassert(p, ...)
< prev index next >