Index: third_party/tcmalloc/chromium/src/libc_override.h |
diff --git a/third_party/tcmalloc/chromium/src/libc_override.h b/third_party/tcmalloc/chromium/src/libc_override.h |
index 089084a2e4988d34fd0723f4d651f194e264a2c4..941d3924a6a24b09d950f2d6998000fa2d4bd51a 100644 |
--- a/third_party/tcmalloc/chromium/src/libc_override.h |
+++ b/third_party/tcmalloc/chromium/src/libc_override.h |
@@ -59,12 +59,22 @@ |
static void ReplaceSystemAlloc(); // defined in the .h files below |
+#if defined(TCMALLOC_DONT_REPLACE_SYSTEM_ALLOC) |
+// TCMALLOC_DONT_REPLACE_SYSTEM_ALLOC has the following semantic: |
+// - tcmalloc with all its tc_* (tc_malloc, tc_free) symbols is being built |
+// and linked as usual. |
+// - the default system allocator symbols (malloc, free, operator new) are NOT |
+// overridden. The embedded must take care of routing them to tc_* symbols. |
+// This no-op #if block effectively prevents the inclusion of the |
+// libc_override_* headers below. |
+static void ReplaceSystemAlloc() {} |
Nico
2016/02/09 20:14:23
Which files include this? Defining static function
Primiano Tucci (use gerrit)
2016/02/09 20:34:23
So I think that the deal is that this header is a
|
+ |
// For windows, there are two ways to get tcmalloc. If we're |
// patching, then src/windows/patch_function.cc will do the necessary |
// overriding here. Otherwise, we doing the 'redefine' trick, where |
// we remove malloc/new/etc from mscvcrt.dll, and just need to define |
// them now. |
-#if defined(_WIN32) && defined(WIN32_DO_PATCHING) |
+#elif defined(_WIN32) && defined(WIN32_DO_PATCHING) |
void PatchWindowsFunctions(); // in src/windows/patch_function.cc |
static void ReplaceSystemAlloc() { PatchWindowsFunctions(); } |