< prev index next >
src/share/vm/logging/logStream.hpp
Print this page
rev 13105 : imported patch 8181917-refactor-ul-logstream-alt1-callsite-changes
rev 13106 : imported patch 8181917-refactor-ul-logstream-alt1-api-changes
rev 13107 : imported patch 8181917-refactor-ul-logstream-alt1-logstream-optimization
*** 30,42 ****
#include "memory/resourceArea.hpp"
#include "utilities/ostream.hpp"
class LogStream : public outputStream {
! bufferedStream _current_line;
LogTargetHandle _log_handle;
public:
// Constructor to support creation from a LogTarget instance.
//
// LogTarget(Debug, gc) log;
// LogStreamBase(log) stream;
--- 30,64 ----
#include "memory/resourceArea.hpp"
#include "utilities/ostream.hpp"
class LogStream : public outputStream {
!
! // Helper class, maintains the line buffer. For small line lengths,
! // we avoid malloc and use a fixed sized member char array. If LogStream
! // is allocated on the stack, this means small lines are assembled
! // directly on the stack.
! class LineBuffer {
! char _smallbuf[128];
! char* _buf;
! size_t _cap;
! size_t _pos;
! void ensure_cap(size_t cap);
! public:
! LineBuffer();
! ~LineBuffer();
! const char* ptr() const { return _buf; }
! void append(const char* s, size_t len);
! void reset();
! };
! LineBuffer _current_line;
LogTargetHandle _log_handle;
+ // Prevent operator new for LogStream.
+ // static void* operator new (size_t);
+ // static void* operator new[] (size_t);
+
public:
// Constructor to support creation from a LogTarget instance.
//
// LogTarget(Debug, gc) log;
// LogStreamBase(log) stream;
*** 63,76 ****
// Constructor to support creation from a log level and tagset.
//
// LogStreamBase(level, tageset);
LogStream(LogLevelType level, LogTagSet* tagset) : _log_handle(level, tagset) {}
- ~LogStream() {
- guarantee(_current_line.size() == 0, "Buffer not flushed. Missing call to print_cr()?");
- }
-
public:
void write(const char* s, size_t len);
};
typedef LogStream LogStreamNoResourceMark;
--- 85,94 ----
< prev index next >