summaryrefslogtreecommitdiffstats
path: root/base/process_util_linux.cc
diff options
context:
space:
mode:
authoreugenis@chromium.org <eugenis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-20 17:23:09 +0000
committereugenis@chromium.org <eugenis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-20 17:23:09 +0000
commit890d819cbce76ee361a05f8c216a16a1485cf850 (patch)
tree81e01e68ccafd543e6bac711b10f613b25039525 /base/process_util_linux.cc
parente817e48a587c9fc429328c1feeb1c982eda15a72 (diff)
downloadchromium_src-890d819cbce76ee361a05f8c216a16a1485cf850.zip
chromium_src-890d819cbce76ee361a05f8c216a16a1485cf850.tar.gz
chromium_src-890d819cbce76ee361a05f8c216a16a1485cf850.tar.bz2
Don't override system malloc when built with MemorySanitizer.
This conflicts with MSan's malloc interception. We already do the same for ASan and TSan. BUG=178409 R=mark@chromium.org,darin@chromium.org Review URL: https://chromiumcodereview.appspot.com/12521015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@189327 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/process_util_linux.cc')
-rw-r--r--base/process_util_linux.cc9
1 files changed, 4 insertions, 5 deletions
diff --git a/base/process_util_linux.cc b/base/process_util_linux.cc
index 6355e37..2af9227 100644
--- a/base/process_util_linux.cc
+++ b/base/process_util_linux.cc
@@ -748,9 +748,9 @@ void OnNoMemory() {
} // namespace
-extern "C" {
-#if !defined(USE_TCMALLOC) && !defined(ADDRESS_SANITIZER) && \
- !defined(OS_ANDROID) && !defined(THREAD_SANITIZER)
+#if !defined(OS_ANDROID) && !defined(USE_TCMALLOC) && \
+ !defined(ADDRESS_SANITIZER) && !defined(MEMORY_SANITIZER) && \
+ !defined(THREAD_SANITIZER)
extern "C" {
void* __libc_malloc(size_t size);
@@ -759,7 +759,6 @@ void* __libc_calloc(size_t nmemb, size_t size);
void* __libc_valloc(size_t size);
void* __libc_pvalloc(size_t size);
void* __libc_memalign(size_t alignment, size_t size);
-} // extern "C"
// Overriding the system memory allocation functions:
//
@@ -829,8 +828,8 @@ int posix_memalign(void** ptr, size_t alignment, size_t size) {
return 0;
}
-#endif // !defined(USE_TCMALLOC)
} // extern C
+#endif // ANDROID, TCMALLOC, *_SANITIZER
void EnableTerminationOnHeapCorruption() {
// On Linux, there nothing to do AFAIK.