Implement a dynamically growing memory log buffer with an upper limit.
authormikhail.naganov@gmail.com <mikhail.naganov@gmail.com@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Thu, 28 May 2009 07:08:09 +0000 (07:08 +0000)
committermikhail.naganov@gmail.com <mikhail.naganov@gmail.com@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Thu, 28 May 2009 07:08:09 +0000 (07:08 +0000)
commite48095b87cd823a523905f9e559a1a90c201f192
tree6483277e13fa32ce4717c446f0e07ef29299e4ca
parent4014f6428d05d55356a4820ca9c41eefe1e5104a
Implement a dynamically growing memory log buffer with an upper limit.

The goal of this change is to allow longer profiling sessions and preserve memory when profiler isn't started. The buffer starts with 64K and grows until it reaches the upper limit, which is currently set to 50MB --- according to my evaluations, this is enough for at least 20 minutes of GMail profiling. As we're planning to introduce compression for the profiler log, this time boundary will be significantly increased soon.

To make possible unit testing of the new component, I've factored out Logger's utility classes into a separate source file: log-utils.h/cc. Log and LogMessageBuilder are moved there from log.cc without any semantical changes.

Review URL: http://codereview.chromium.org/115814

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2067 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
13 files changed:
src/SConscript
src/log-utils.cc [new file with mode: 0644]
src/log-utils.h [new file with mode: 0644]
src/log.cc
test/cctest/SConscript
test/cctest/test-log-utils.cc [new file with mode: 0644]
test/cctest/test-log.cc
tools/gyp/v8.gyp
tools/v8.xcodeproj/project.pbxproj
tools/visual_studio/v8_base.vcproj
tools/visual_studio/v8_base_arm.vcproj
tools/visual_studio/v8_cctest.vcproj
tools/visual_studio/v8_cctest_arm.vcproj