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

Unified Diff: base/security_unittest.cc

Issue 16077014: Reenable the tcmalloc SecurityTests in base_unittests on Windows (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix nit Created 7 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/security_unittest.cc
diff --git a/base/security_unittest.cc b/base/security_unittest.cc
index 7ac6c4ddb4bc0cef13b7e02e147282ded25b4f26..5b266b0a11c434b480e54ee3ad1fa8fbcdd25ce9 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"))
+ return true;
#endif
return false;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698