Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(546)

Unified Diff: src/log.cc

Issue 1396843004: improve perf_basic_prof filename reporting (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: shorten url in comment Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | test/cctest/test-log.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/log.cc
diff --git a/src/log.cc b/src/log.cc
index b9eb577b2054f5c5e84d7b02f91425ff06522f65..ea69fb4bee3e71cecb6ae6a38f8dba69445b3657 100644
--- a/src/log.cc
+++ b/src/log.cc
@@ -123,8 +123,9 @@ class CodeEventLogger::NameBuffer {
}
void AppendInt(int n) {
- Vector<char> buffer(utf8_buffer_ + utf8_pos_,
- kUtf8BufferSize - utf8_pos_);
+ int space = kUtf8BufferSize - utf8_pos_;
+ if (space <= 0) return;
+ Vector<char> buffer(utf8_buffer_ + utf8_pos_, space);
int size = SNPrintF(buffer, "%d", n);
if (size > 0 && utf8_pos_ + size <= kUtf8BufferSize) {
utf8_pos_ += size;
@@ -132,8 +133,9 @@ class CodeEventLogger::NameBuffer {
}
void AppendHex(uint32_t n) {
- Vector<char> buffer(utf8_buffer_ + utf8_pos_,
- kUtf8BufferSize - utf8_pos_);
+ int space = kUtf8BufferSize - utf8_pos_;
+ if (space <= 0) return;
+ Vector<char> buffer(utf8_buffer_ + utf8_pos_, space);
int size = SNPrintF(buffer, "%x", n);
if (size > 0 && utf8_pos_ + size <= kUtf8BufferSize) {
utf8_pos_ += size;
@@ -145,7 +147,7 @@ class CodeEventLogger::NameBuffer {
private:
static const int kUtf8BufferSize = 512;
- static const int kUtf16BufferSize = 128;
+ static const int kUtf16BufferSize = kUtf8BufferSize;
int utf8_pos_;
char utf8_buffer_[kUtf8BufferSize];
« no previous file with comments | « no previous file | test/cctest/test-log.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698