Index: third_party/tcmalloc/chromium/src/internal_logging.cc |
=================================================================== |
--- third_party/tcmalloc/chromium/src/internal_logging.cc (revision 87277) |
+++ third_party/tcmalloc/chromium/src/internal_logging.cc (working copy) |
@@ -31,14 +31,18 @@ |
// Sanjay Ghemawat <opensource@google.com> |
#include <config.h> |
-#include <stdio.h> |
-#include <stdarg.h> |
+#include "internal_logging.h" |
+#include <stdarg.h> // for va_end, va_start |
+#include <stdio.h> // for vsnprintf, va_list, etc |
+#include <stdlib.h> // for abort |
+#include <string.h> // for strlen, memcpy |
#ifdef HAVE_UNISTD_H |
#include <unistd.h> // for write() |
#endif |
-#include <string.h> |
+ |
#include <google/malloc_extension.h> |
-#include "internal_logging.h" |
+#include "base/logging.h" // for perftools_vsnprintf |
+#include "base/spinlock.h" // for SpinLockHolder, SpinLock |
static const int kLogBufSize = 800; |
@@ -50,7 +54,7 @@ |
if (n < kLogBufSize) { |
va_list ap; |
va_start(ap, format); |
- vsnprintf(buf + n, kLogBufSize - n, format, ap); |
+ perftools_vsnprintf(buf + n, kLogBufSize - n, format, ap); |
va_end(ap); |
} |
write(STDERR_FILENO, buf, strlen(buf)); |
@@ -66,7 +70,7 @@ |
char buf[kLogBufSize]; |
const int n = snprintf(buf, sizeof(buf), "%s:%d] ", filename, line_number); |
if (n < kLogBufSize) { |
- vsnprintf(buf + n, kLogBufSize - n, format, ap); |
+ perftools_vsnprintf(buf + n, kLogBufSize - n, format, ap); |
} |
write(STDERR_FILENO, buf, strlen(buf)); |
if (dump_stats) { |
@@ -99,7 +103,7 @@ |
if (left_ > 0) { |
va_list ap; |
va_start(ap, format); |
- const int r = vsnprintf(buf_, left_, format, ap); |
+ const int r = perftools_vsnprintf(buf_, left_, format, ap); |
va_end(ap); |
if (r < 0) { |
// Perhaps an old glibc that returns -1 on truncation? |