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

Unified Diff: third_party/tcmalloc/chromium/src/google/malloc_hook.h

Issue 9320005: [NOT TO COMMIT!] Replace third_party/tcmalloc/chromium with tcmalloc r136 (the latest). (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Created 8 years, 11 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
Index: third_party/tcmalloc/chromium/src/google/malloc_hook.h
diff --git a/third_party/tcmalloc/chromium/src/google/malloc_hook.h b/third_party/tcmalloc/chromium/src/google/malloc_hook.h
index f5575f13999f267d2351bdb29bbf228aec205193..245d0e16fd5ce083a463f6edc1b9197376e3a742 100644
--- a/third_party/tcmalloc/chromium/src/google/malloc_hook.h
+++ b/third_party/tcmalloc/chromium/src/google/malloc_hook.h
@@ -81,6 +81,14 @@ extern "C" {
# endif
#endif
+// The C++ methods below call the C version (MallocHook_*), and thus
+// convert between an int and a bool. Windows complains about this
+// (a "performance warning") which we don't care about, so we suppress.
+#ifdef _MSC_VER
+#pragma warning(push)
+#pragma warning(disable:4800)
+#endif
+
// Note: malloc_hook_c.h defines MallocHook_*Hook and
// MallocHook_{Add,Remove}*Hook. The version of these inside the MallocHook
// class are defined in terms of the malloc_hook_c version. See malloc_hook_c.h
@@ -229,7 +237,7 @@ class PERFTOOLS_DLL_DECL MallocHook {
inline static bool RemovePreSbrkHook(PreSbrkHook hook) {
return MallocHook_RemovePreSbrkHook(hook);
}
- inline static void InvokePreSbrkHook(std::ptrdiff_t increment);
+ inline static void InvokePreSbrkHook(ptrdiff_t increment);
// The SbrkHook is invoked whenever sbrk is called -- except when
// the increment is 0. This is because sbrk(0) is often called
@@ -242,7 +250,7 @@ class PERFTOOLS_DLL_DECL MallocHook {
inline static bool RemoveSbrkHook(SbrkHook hook) {
return MallocHook_RemoveSbrkHook(hook);
}
- inline static void InvokeSbrkHook(const void* result, std::ptrdiff_t increment);
+ inline static void InvokeSbrkHook(const void* result, ptrdiff_t increment);
// Get the current stack trace. Try to skip all routines up to and
// and including the caller of MallocHook::Invoke*.
@@ -338,8 +346,13 @@ class PERFTOOLS_DLL_DECL MallocHook {
size_t new_size,
int flags,
const void* new_addr);
- static void InvokePreSbrkHookSlow(std::ptrdiff_t increment);
- static void InvokeSbrkHookSlow(const void* result, std::ptrdiff_t increment);
+ static void InvokePreSbrkHookSlow(ptrdiff_t increment);
+ static void InvokeSbrkHookSlow(const void* result, ptrdiff_t increment);
};
+#ifdef _MSC_VER
+#pragma warning(pop)
+#endif
+
+
#endif /* _MALLOC_HOOK_H_ */

Powered by Google App Engine
This is Rietveld 408576698