| Index: src/log.h
|
| ===================================================================
|
| --- src/log.h (revision 1277)
|
| +++ src/log.h (working copy)
|
| @@ -69,6 +69,7 @@
|
| class Profiler;
|
| class Semaphore;
|
| class SlidingStateWindow;
|
| +class LogMessageBuilder;
|
|
|
| #undef LOG
|
| #ifdef ENABLE_LOGGING_AND_PROFILING
|
| @@ -227,8 +228,15 @@
|
| // Logs a StringEvent regardless of whether FLAG_log is true.
|
| static void UncheckedStringEvent(const char* name, const char* value);
|
|
|
| - // When logging is active, logfile_ refers the file
|
| - // events are written to.
|
| + // Size of buffer used for formatting log messages.
|
| + static const int kMessageBufferSize = 256;
|
| +
|
| + // Buffer used for formatting log messages. This is a singleton buffer and
|
| + // mutex_ should be acquired before using it.
|
| + static char* message_buffer_;
|
| +
|
| + // When logging is active, logfile_ refers the file events are written to.
|
| + // mutex_ should be acquired before using logfile_.
|
| static FILE* logfile_;
|
|
|
| // The sampler used by the profiler and the sliding state window.
|
| @@ -240,7 +248,7 @@
|
| static Profiler* profiler_;
|
|
|
| // mutex_ is a Mutex used for enforcing exclusive
|
| - // access to the log file.
|
| + // access to the formatting buffer and the log file.
|
| static Mutex* mutex_;
|
|
|
| // A stack of VM states.
|
| @@ -252,6 +260,7 @@
|
|
|
| // Internal implementation classes with access to
|
| // private members.
|
| + friend class LogMessageBuilder;
|
| friend class EventLog;
|
| friend class TimeLog;
|
| friend class Profiler;
|
|
|