Index: third_party/tcmalloc/chromium/src/tests/debugallocation_test.cc |
diff --git a/third_party/tcmalloc/chromium/src/tests/debugallocation_test.cc b/third_party/tcmalloc/chromium/src/tests/debugallocation_test.cc |
index 07b8604b2c0b9eb1052050667414da467600e5f7..56ae30e8146a578a7a5b48ac067cfbf06cf24215 100644 |
--- a/third_party/tcmalloc/chromium/src/tests/debugallocation_test.cc |
+++ b/third_party/tcmalloc/chromium/src/tests/debugallocation_test.cc |
@@ -33,7 +33,7 @@ |
#include <stdio.h> |
#include <stdlib.h> |
#include <vector> |
-#include "google/malloc_extension.h" |
+#include "gperftools/malloc_extension.h" |
#include "base/logging.h" |
using std::vector; |
@@ -75,7 +75,10 @@ static int test_counter = 0; // incremented every time the macro is called |
// This flag won't be compiled in in opt mode. |
DECLARE_int32(max_free_queue_size); |
-// Test match as well as mismatch rules: |
+// Test match as well as mismatch rules. But do not test on OS X; on |
+// OS X the OS converts new/new[] to malloc before it gets to us, so |
+// we are unable to catch these mismatch errors. |
+#ifndef __APPLE__ |
TEST(DebugAllocationTest, DeallocMismatch) { |
// malloc can be matched only by free |
// new can be matched only by delete and delete(nothrow) |
@@ -132,6 +135,7 @@ TEST(DebugAllocationTest, DeallocMismatch) { |
::operator delete[](y, std::nothrow); |
} |
} |
+#endif // #ifdef OS_MACOSX |
TEST(DebugAllocationTest, DoubleFree) { |
int* pint = new int; |