diff options
author | phajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-15 19:01:12 +0000 |
---|---|---|
committer | phajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-15 19:01:12 +0000 |
commit | 83ba8d41e4d7e7515c5ad2273697596ed0d98876 (patch) | |
tree | 93489b176b1952f76b7cc024740b94ab5bf487d6 /third_party/tcmalloc | |
parent | 5e6b0faa6bd24fc7735d56da55340586a89252df (diff) | |
download | chromium_src-83ba8d41e4d7e7515c5ad2273697596ed0d98876.zip chromium_src-83ba8d41e4d7e7515c5ad2273697596ed0d98876.tar.gz chromium_src-83ba8d41e4d7e7515c5ad2273697596ed0d98876.tar.bz2 |
GTTF: Enable tcmalloc's debugallocation on Windows.
BUG=30715
R=jar@chromium.org, rtenneti@chromium.org
Review URL: https://codereview.chromium.org/15100010
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@200327 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'third_party/tcmalloc')
-rw-r--r-- | third_party/tcmalloc/chromium/src/config_win.h | 2 | ||||
-rw-r--r-- | third_party/tcmalloc/chromium/src/debugallocation.cc | 15 | ||||
-rw-r--r-- | third_party/tcmalloc/chromium/src/windows/port.h | 3 |
3 files changed, 9 insertions, 11 deletions
diff --git a/third_party/tcmalloc/chromium/src/config_win.h b/third_party/tcmalloc/chromium/src/config_win.h index db4c518..e6506e4 100644 --- a/third_party/tcmalloc/chromium/src/config_win.h +++ b/third_party/tcmalloc/chromium/src/config_win.h @@ -74,7 +74,7 @@ #undef HAVE_EXECINFO_H /* Define to 1 if you have the <fcntl.h> header file. */ -#undef HAVE_FCNTL_H +#define HAVE_FCNTL_H 1 /* Define to 1 if you have the <features.h> header file. */ #undef HAVE_FEATURES_H diff --git a/third_party/tcmalloc/chromium/src/debugallocation.cc b/third_party/tcmalloc/chromium/src/debugallocation.cc index cccaf98..7b09e41 100644 --- a/third_party/tcmalloc/chromium/src/debugallocation.cc +++ b/third_party/tcmalloc/chromium/src/debugallocation.cc @@ -127,19 +127,16 @@ DEFINE_bool(symbolize_stacktrace, EnvToBool("TCMALLOC_SYMBOLIZE_STACKTRACE", true), "Symbolize the stack trace when provided (on some error exits)"); -// If we are LD_PRELOAD-ed against a non-pthreads app, then -// pthread_once won't be defined. We declare it here, for that -// case (with weak linkage) which will cause the non-definition to -// resolve to NULL. We can then check for NULL or not in Instance. -extern "C" int pthread_once(pthread_once_t *, void (*)(void)) - ATTRIBUTE_WEAK; - // ========================================================================= // // A safe version of printf() that does not do any allocation and // uses very little stack space. static void TracePrintf(int fd, const char *fmt, ...) +#ifdef __GNUC__ __attribute__ ((__format__ (__printf__, 2, 3))); +#else + ; +#endif // The do_* functions are defined in tcmalloc/tcmalloc.cc, // which is included before this file @@ -624,9 +621,7 @@ class MallocBlock { } static void CheckForDanglingWrites(const MallocBlockQueueEntry& queue_entry) { - // Initialize the buffer if necessary. - if (pthread_once) - pthread_once(&deleted_buffer_initialized_, &InitDeletedBuffer); + perftools_pthread_once(&deleted_buffer_initialized_, &InitDeletedBuffer); if (!deleted_buffer_initialized_no_pthreads_) { // This will be the case on systems that don't link in pthreads, // including on FreeBSD where pthread_once has a non-zero address diff --git a/third_party/tcmalloc/chromium/src/windows/port.h b/third_party/tcmalloc/chromium/src/windows/port.h index e9a0206..c2381091 100644 --- a/third_party/tcmalloc/chromium/src/windows/port.h +++ b/third_party/tcmalloc/chromium/src/windows/port.h @@ -49,6 +49,9 @@ #ifdef _WIN32 +#ifndef NOMINMAX +#define NOMINMAX /* Do not define min and max macros. */ +#endif #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN /* We always want minimal includes */ #endif |