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

Unified Diff: third_party/tcmalloc/chromium/src/internal_logging.cc

Issue 7050034: Merge google-perftools r109 (the current contents of third_party/tcmalloc/vendor) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 6 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
Index: third_party/tcmalloc/chromium/src/internal_logging.cc
===================================================================
--- third_party/tcmalloc/chromium/src/internal_logging.cc (revision 88335)
+++ 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?
« no previous file with comments | « third_party/tcmalloc/chromium/src/internal_logging.h ('k') | third_party/tcmalloc/chromium/src/linked_list.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698