Chromium Code Reviews| Index: base/security_unittest.cc |
| diff --git a/base/security_unittest.cc b/base/security_unittest.cc |
| index 7ac6c4ddb4bc0cef13b7e02e147282ded25b4f26..ea00db5756ab47c5659d0c9ca6765281f07b013e 100644 |
| --- a/base/security_unittest.cc |
| +++ b/base/security_unittest.cc |
| @@ -46,9 +46,8 @@ Type HideValueFromCompiler(volatile Type value) { |
| // - ADDRESS_SANITIZER because it has its own memory allocator |
| // - IOS does not use tcmalloc |
| // - OS_MACOSX does not use tcmalloc |
| -// - OS_WIN does not use tcmalloc crbug.com/242304 |
| #if !defined(NO_TCMALLOC) && !defined(ADDRESS_SANITIZER) && \ |
| - !defined(OS_IOS) && !defined(OS_MACOSX) && !defined(OS_WIN) |
| + !defined(OS_IOS) && !defined(OS_MACOSX) |
| #define TCMALLOC_TEST(function) function |
| #else |
| #define TCMALLOC_TEST(function) DISABLED_##function |
| @@ -65,6 +64,12 @@ bool IsTcMallocBypassed() { |
| char* g_slice = getenv("G_SLICE"); |
| if (g_slice && !strcmp(g_slice, "always-malloc")) |
| return true; |
| +#elif defined(OS_WIN) |
| + // This should detect a TCMalloc bypass from setting |
| + // the CHROME_ALLOCATOR environment variable. |
| + char* allocator = getenv("CHROME_ALLOCATOR"); |
| + if (allocator && strcmp(allocator, "tcmalloc") != 0) |
|
jln (very slow on Chromium)
2013/06/10 16:59:15
nit: removing the != 0 is the usual Chrome style.
|
| + return true; |
| #endif |
| return false; |
| } |