diff options
author | hans@chromium.org <hans@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-07-25 19:58:16 +0000 |
---|---|---|
committer | hans@chromium.org <hans@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-07-25 19:58:16 +0000 |
commit | be6a9b575170f403812566613c27dbd909b10931 (patch) | |
tree | b4af84cdae8a655054039ac4e31111147e1e46ea /third_party/tcmalloc | |
parent | b36e66174d685a4195d7cc934d978086e033a8c4 (diff) | |
download | chromium_src-be6a9b575170f403812566613c27dbd909b10931.zip chromium_src-be6a9b575170f403812566613c27dbd909b10931.tar.gz chromium_src-be6a9b575170f403812566613c27dbd909b10931.tar.bz2 |
It is important that 'struct mallinfo' is defined in the header file.
Otherwise, Clang will warn about the declaration of 'tc_mallinfo' because it has C-linkage, but has an incomplete return type.
This was sent upstream in http://code.google.com/p/gperftools/issues/detail?id=450
BUG=138571
TEST=it builds without warning
Review URL: https://chromiumcodereview.appspot.com/10818025
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@148386 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'third_party/tcmalloc')
-rw-r--r-- | third_party/tcmalloc/chromium/src/gperftools/tcmalloc.h | 12 | ||||
-rw-r--r-- | third_party/tcmalloc/chromium/src/tcmalloc.cc | 12 |
2 files changed, 11 insertions, 13 deletions
diff --git a/third_party/tcmalloc/chromium/src/gperftools/tcmalloc.h b/third_party/tcmalloc/chromium/src/gperftools/tcmalloc.h index 7c88917..a3f036f 100644 --- a/third_party/tcmalloc/chromium/src/gperftools/tcmalloc.h +++ b/third_party/tcmalloc/chromium/src/gperftools/tcmalloc.h @@ -53,7 +53,17 @@ #define TC_VERSION_PATCH "" #define TC_VERSION_STRING "gperftools 2.0" -#include <stdlib.h> // for struct mallinfo, if it's defined +// For struct mallinfo, it it's defined. +#ifdef HAVE_STRUCT_MALLINFO +// Malloc can be in several places on older versions of OS X. +# if defined(HAVE_MALLOC_H) +# include <malloc.h> +# elif defined(HAVE_SYS_MALLOC_H) +# include <sys/malloc.h> +# elif defined(HAVE_MALLOC_MALLOC_H) +# include <malloc/malloc.h> +# endif +#endif // Annoying stuff for windows -- makes sure clients can import these functions #ifndef PERFTOOLS_DLL_DECL diff --git a/third_party/tcmalloc/chromium/src/tcmalloc.cc b/third_party/tcmalloc/chromium/src/tcmalloc.cc index aa29436..2ff2a3b 100644 --- a/third_party/tcmalloc/chromium/src/tcmalloc.cc +++ b/third_party/tcmalloc/chromium/src/tcmalloc.cc @@ -131,18 +131,6 @@ #include "tcmalloc_guard.h" // for TCMallocGuard #include "thread_cache.h" // for ThreadCache -// We only need malloc.h for struct mallinfo. -#ifdef HAVE_STRUCT_MALLINFO -// Malloc can be in several places on older versions of OS X. -# if defined(HAVE_MALLOC_H) -# include <malloc.h> -# elif defined(HAVE_SYS_MALLOC_H) -# include <sys/malloc.h> -# elif defined(HAVE_MALLOC_MALLOC_H) -# include <malloc/malloc.h> -# endif -#endif - #if (defined(_WIN32) && !defined(__CYGWIN__) && !defined(__CYGWIN32__)) && !defined(WIN32_OVERRIDE_ALLOCATORS) # define WIN32_DO_PATCHING 1 #endif |