diff options
Diffstat (limited to 'third_party/tcmalloc/chromium/src/internal_logging.cc')
| -rw-r--r-- | third_party/tcmalloc/chromium/src/internal_logging.cc | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/third_party/tcmalloc/chromium/src/internal_logging.cc b/third_party/tcmalloc/chromium/src/internal_logging.cc index ea8e56f1..4c90190 100644 --- a/third_party/tcmalloc/chromium/src/internal_logging.cc +++ b/third_party/tcmalloc/chromium/src/internal_logging.cc @@ -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 @@ void TCMalloc_MESSAGE(const char* filename, 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 @@ static void TCMalloc_CRASH_internal(bool dump_stats, 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 @@ void TCMalloc_Printer::printf(const char* format, ...) { 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? |
