diff options
author | willchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-29 03:12:23 +0000 |
---|---|---|
committer | willchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-29 03:12:23 +0000 |
commit | 9eee685c92a827c57106fe887c3da1e600a88e17 (patch) | |
tree | 2e7d2a470efb31559d7fc674c0fdcd91f2c53b7b | |
parent | fc71bb7b2d1420df75b530be4e1d65cbe6a416cd (diff) | |
download | chromium_src-9eee685c92a827c57106fe887c3da1e600a88e17.zip chromium_src-9eee685c92a827c57106fe887c3da1e600a88e17.tar.gz chromium_src-9eee685c92a827c57106fe887c3da1e600a88e17.tar.bz2 |
Experiment: Enable tcmalloc for linux (Take 2). Will revert after a buildbot cycle.
Review URL: http://codereview.chromium.org/160313
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21938 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | base/base.gyp | 1 | ||||
-rw-r--r-- | third_party/tcmalloc/config.h | 273 | ||||
-rw-r--r-- | third_party/tcmalloc/config_linux.h | 225 | ||||
-rw-r--r-- | third_party/tcmalloc/config_win.h | 267 | ||||
-rw-r--r-- | third_party/tcmalloc/tcmalloc.gyp | 40 |
5 files changed, 543 insertions, 263 deletions
diff --git a/base/base.gyp b/base/base.gyp index 8aa8a3a..4db43e2 100644 --- a/base/base.gyp +++ b/base/base.gyp @@ -434,6 +434,7 @@ '../build/util/build_util.gyp:lastchange', '../build/linux/system.gyp:gtk', '../build/linux/system.gyp:nss', + '../third_party/tcmalloc/tcmalloc.gyp:tcmalloc', ], 'cflags': [ '-Wno-write-strings', diff --git a/third_party/tcmalloc/config.h b/third_party/tcmalloc/config.h index 9f4efa8..e9e12bd 100644 --- a/third_party/tcmalloc/config.h +++ b/third_party/tcmalloc/config.h @@ -1,267 +1,14 @@ -/* A manual version of config.h fit for windows machines. */ +// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. -/* Sometimes we accidentally #include this config.h instead of the one - in .. -- this is particularly true for msys/mingw, which uses the - unix config.h but also runs code in the windows directory. - */ -#ifdef __MINGW32__ -#include "../config.h" -#define GOOGLE_PERFTOOLS_WINDOWS_CONFIG_H_ -#endif - -#ifndef GOOGLE_PERFTOOLS_WINDOWS_CONFIG_H_ -#define GOOGLE_PERFTOOLS_WINDOWS_CONFIG_H_ - -/* define this if you are linking tcmalloc statically and overriding the - * default allocators. - * For instructions on how to use this mode, see - * http://groups.google.com/group/google-perftools/browse_thread/thread/41cd3710af85e57b - */ -#define WIN32_OVERRIDE_ALLOCATORS - -/* the location of <hash_map> */ -#define HASH_MAP_H <hash_map> - -/* the namespace of hash_map/hash_set */ -#define HASH_NAMESPACE stdext - -/* the location of <hash_set> */ -#define HASH_SET_H <hash_set> - -/* Define to 1 if your libc has a snprintf implementation */ -#define HAVE_SNPRINTF - -/* Define to 1 if compiler supports __builtin_stack_pointer */ -#undef HAVE_BUILTIN_STACK_POINTER - -/* Define to 1 if you have the <conflict-signal.h> header file. */ -#undef HAVE_CONFLICT_SIGNAL_H - -/* Define to 1 if you have the declaration of `cfree', and to 0 if you don't. - */ -#undef HAVE_DECL_CFREE - -/* Define to 1 if you have the declaration of `memalign', and to 0 if you - don't. */ -#undef HAVE_DECL_MEMALIGN - -/* Define to 1 if you have the declaration of `posix_memalign', and to 0 if - you don't. */ -#undef HAVE_DECL_POSIX_MEMALIGN - -/* Define to 1 if you have the declaration of `pvalloc', and to 0 if you - don't. */ -#undef HAVE_DECL_PVALLOC - -/* Define to 1 if you have the declaration of `uname', and to 0 if you don't. - */ -#undef HAVE_DECL_UNAME - -/* Define to 1 if you have the declaration of `valloc', and to 0 if you don't. - */ -#undef HAVE_DECL_VALLOC - -/* Define to 1 if you have the <dlfcn.h> header file. */ -#undef HAVE_DLFCN_H - -/* Define to 1 if the system has the type `Elf32_Versym'. */ -#undef HAVE_ELF32_VERSYM - -/* Define to 1 if you have the <execinfo.h> header file. */ -#undef HAVE_EXECINFO_H - -/* Define to 1 if you have the <fcntl.h> header file. */ -#undef HAVE_FCNTL_H - -/* Define to 1 if you have the `geteuid' function. */ -#undef HAVE_GETEUID - -/* Define to 1 if you have the `getpagesize' function. */ -#define HAVE_GETPAGESIZE 1 /* we define it in windows/port.cc */ - -/* Define to 1 if you have the <glob.h> header file. */ -#undef HAVE_GLOB_H - -/* Define to 1 if you have the <grp.h> header file. */ -#undef HAVE_GRP_H - -/* define if the compiler has hash_map */ -#define HAVE_HASH_MAP 1 - -/* define if the compiler has hash_set */ -#define HAVE_HASH_SET 1 - -/* Define to 1 if you have the <inttypes.h> header file. */ -#undef HAVE_INTTYPES_H - -/* Define to 1 if you have the <libunwind.h> header file. */ -#undef HAVE_LIBUNWIND_H - -/* Define to 1 if you have the <linux/ptrace.h> header file. */ -#undef HAVE_LINUX_PTRACE_H - -/* Define to 1 if you have the <malloc.h> header file. */ -#undef HAVE_MALLOC_H - -/* Define to 1 if you have the <memory.h> header file. */ -#undef HAVE_MEMORY_H - -/* Define to 1 if you have a working `mmap' system call. */ -#undef HAVE_MMAP - -/* define if the compiler implements namespaces */ -#define HAVE_NAMESPACES 1 - -/* define if libc has program_invocation_name */ -#undef HAVE_PROGRAM_INVOCATION_NAME - -/* Define if you have POSIX threads libraries and header files. */ -#undef HAVE_PTHREAD - -/* Define to 1 if you have the <pwd.h> header file. */ -#undef HAVE_PWD_H - -/* Define to 1 if you have the `sbrk' function. */ -#undef HAVE_SBRK - -/* Define to 1 if you have the <stdint.h> header file. */ -#undef HAVE_STDINT_H - -/* Define to 1 if you have the <stdlib.h> header file. */ -#define HAVE_STDLIB_H 1 - -/* Define to 1 if you have the <strings.h> header file. */ -#undef HAVE_STRINGS_H - -/* Define to 1 if you have the <string.h> header file. */ -#define HAVE_STRING_H 1 +#ifndef CONFIG_H_ -/* Define to 1 if the system has the type `struct mallinfo'. */ -#undef HAVE_STRUCT_MALLINFO - -/* Define to 1 if you have the <sys/prctl.h> header file. */ -#undef HAVE_SYS_PRCTL_H - -/* Define to 1 if you have the <sys/resource.h> header file. */ -#undef HAVE_SYS_RESOURCE_H - -/* Define to 1 if you have the <sys/socket.h> header file. */ -#undef HAVE_SYS_SOCKET_H - -/* Define to 1 if you have the <sys/stat.h> header file. */ -#define HAVE_SYS_STAT_H 1 - -/* Define to 1 if you have the <sys/syscall.h> header file. */ -#undef HAVE_SYS_SYSCALL_H - -/* Define to 1 if you have the <sys/types.h> header file. */ -#define HAVE_SYS_TYPES_H 1 - -/* Define to 1 if you have the <sys/wait.h> header file. */ -#undef HAVE_SYS_WAIT_H - -/* Define to 1 if compiler supports __thread */ -#undef HAVE_TLS - -/* Define to 1 if you have the <ucontext.h> header file. */ -#undef HAVE_UCONTEXT_H - -/* Define to 1 if you have the <unistd.h> header file. */ -#undef HAVE_UNISTD_H - -/* Define to 1 if you have the <unwind.h> header file. */ -#undef HAVE_UNWIND_H - -/* define if your compiler has __attribute__ */ -#undef HAVE___ATTRIBUTE__ - -/* Define to 1 if the system has the type `__int64'. */ -#define HAVE___INT64 1 - -/* prefix where we look for installed files */ -#undef INSTALL_PREFIX - -/* Define to 1 if int32_t is equivalent to intptr_t */ -#undef INT32_EQUALS_INTPTR - -/* Define to 1 if your C compiler doesn't accept -c and -o together. */ -#undef NO_MINUS_C_MINUS_O - -/* Name of package */ -#undef PACKAGE - -/* Define to the address where bug reports for this package should be sent. */ -#undef PACKAGE_BUGREPORT - -/* Define to the full name of this package. */ -#undef PACKAGE_NAME - -/* Define to the full name and version of this package. */ -#undef PACKAGE_STRING - -/* Define to the one symbol short name of this package. */ -#undef PACKAGE_TARNAME - -/* Define to the version of this package. */ -#undef PACKAGE_VERSION - -/* How to access the PC from a struct ucontext */ -#undef PC_FROM_UCONTEXT - -/* Always the empty-string on non-windows systems. On windows, should be - "__declspec(dllexport)". This way, when we compile the dll, we export our - functions/classes. It's safe to define this here because config.h is only - used internally, to compile the DLL, and every DLL source file #includes - "config.h" before anything else. */ -#ifndef PERFTOOLS_DLL_DECL -# define PERFTOOLS_IS_A_DLL 1 /* not set if you're statically linking */ -# define PERFTOOLS_DLL_DECL __declspec(dllexport) -# define PERFTOOLS_DLL_DECL_FOR_UNITTESTS __declspec(dllimport) +#include "build/build_config.h" +#if defined(OS_WIN) +#include "third_party/tcmalloc/config_win.h" +#elif defined(OS_LINUX) +#include "third_party/tcmalloc/config_linux.h" #endif -/* printf format code for printing a size_t and ssize_t */ -#define PRIdS "Id" - -/* printf format code for printing a size_t and ssize_t */ -#define PRIuS "Iu" - -/* printf format code for printing a size_t and ssize_t */ -#define PRIxS "Ix" - -/* Define to necessary symbol if this constant uses a non-standard name on - your system. */ -#undef PTHREAD_CREATE_JOINABLE - -/* Define to 1 if you have the ANSI C header files. */ -#define STDC_HEADERS 1 - -/* the namespace where STL code like vector<> is defined */ -#define STL_NAMESPACE std - -/* Version number of package */ -#undef VERSION - -/* C99 says: define this to get the PRI... macros from stdint.h */ -#ifndef __STDC_FORMAT_MACROS -# define __STDC_FORMAT_MACROS 1 -#endif - -/* Define to `__inline__' or `__inline' if that's what the C compiler - calls it, or to nothing if 'inline' is not supported under any name. */ -#ifndef __cplusplus -#undef inline -#endif - -// --------------------------------------------------------------------- -// Extra stuff not found in config.h.in - -// This must be defined before the windows.h is included. It's needed -// for mutex.h, to give access to the TryLock method. -#ifndef _WIN32_WINNT -# define _WIN32_WINNT 0x0400 -#endif - -// TODO(csilvers): include windows/port.h in every relevant source file instead? -#include "windows/port.h" - -#endif /* GOOGLE_PERFTOOLS_WINDOWS_CONFIG_H_ */ +#endif // CONFIG_H_ diff --git a/third_party/tcmalloc/config_linux.h b/third_party/tcmalloc/config_linux.h new file mode 100644 index 0000000..b359ed5 --- /dev/null +++ b/third_party/tcmalloc/config_linux.h @@ -0,0 +1,225 @@ +/* src/config.h. Generated from config.h.in by configure. */ +/* src/config.h.in. Generated from configure.ac by autoheader. */ + +/* Define to 1 if compiler supports __builtin_stack_pointer */ +/* #undef HAVE_BUILTIN_STACK_POINTER */ + +/* Define to 1 if you have the <conflict-signal.h> header file. */ +/* #undef HAVE_CONFLICT_SIGNAL_H */ + +/* Define to 1 if you have the declaration of `cfree', and to 0 if you don't. + */ +#define HAVE_DECL_CFREE 1 + +/* Define to 1 if you have the declaration of `memalign', and to 0 if you + don't. */ +#define HAVE_DECL_MEMALIGN 1 + +/* Define to 1 if you have the declaration of `posix_memalign', and to 0 if + you don't. */ +#define HAVE_DECL_POSIX_MEMALIGN 1 + +/* Define to 1 if you have the declaration of `pvalloc', and to 0 if you + don't. */ +#define HAVE_DECL_PVALLOC 1 + +/* Define to 1 if you have the declaration of `uname', and to 0 if you don't. + */ +#define HAVE_DECL_UNAME 1 + +/* Define to 1 if you have the declaration of `valloc', and to 0 if you don't. + */ +#define HAVE_DECL_VALLOC 1 + +/* Define to 1 if you have the <dlfcn.h> header file. */ +#define HAVE_DLFCN_H 1 + +/* Define to 1 if the system has the type `Elf32_Versym'. */ +#define HAVE_ELF32_VERSYM 1 + +/* Define to 1 if you have the <execinfo.h> header file. */ +#define HAVE_EXECINFO_H 1 + +/* Define to 1 if you have the <fcntl.h> header file. */ +#define HAVE_FCNTL_H 1 + +/* Define to 1 if you have the <features.h> header file. */ +#define HAVE_FEATURES_H 1 + +/* Define to 1 if you have the `geteuid' function. */ +#define HAVE_GETEUID 1 + +/* Define to 1 if you have the `getpagesize' function. */ +#define HAVE_GETPAGESIZE 1 + +/* Define to 1 if you have the <glob.h> header file. */ +#define HAVE_GLOB_H 1 + +/* Define to 1 if you have the <grp.h> header file. */ +#define HAVE_GRP_H 1 + +/* Define to 1 if you have the <inttypes.h> header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define to 1 if you have the <libunwind.h> header file. */ +/* #undef HAVE_LIBUNWIND_H */ + +/* Define to 1 if you have the <linux/ptrace.h> header file. */ +#define HAVE_LINUX_PTRACE_H 1 + +/* Define to 1 if you have the <malloc.h> header file. */ +#define HAVE_MALLOC_H 1 + +/* Define to 1 if you have the <memory.h> header file. */ +#define HAVE_MEMORY_H 1 + +/* Define to 1 if you have a working `mmap' system call. */ +#define HAVE_MMAP 1 + +/* define if the compiler implements namespaces */ +#define HAVE_NAMESPACES 1 + +/* define if libc has program_invocation_name */ +#define HAVE_PROGRAM_INVOCATION_NAME 1 + +/* Define if you have POSIX threads libraries and header files. */ +#define HAVE_PTHREAD 1 + +/* Define to 1 if you have the <pwd.h> header file. */ +#define HAVE_PWD_H 1 + +/* Define to 1 if you have the `sbrk' function. */ +#define HAVE_SBRK 1 + +/* Define to 1 if you have the <sched.h> header file. */ +#define HAVE_SCHED_H 1 + +/* Define to 1 if you have the <stdint.h> header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the <stdlib.h> header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the <strings.h> header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the <string.h> header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if the system has the type `struct mallinfo'. */ +#define HAVE_STRUCT_MALLINFO 1 + +/* Define to 1 if you have the <sys/prctl.h> header file. */ +#define HAVE_SYS_PRCTL_H 1 + +/* Define to 1 if you have the <sys/resource.h> header file. */ +#define HAVE_SYS_RESOURCE_H 1 + +/* Define to 1 if you have the <sys/socket.h> header file. */ +#define HAVE_SYS_SOCKET_H 1 + +/* Define to 1 if you have the <sys/stat.h> header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the <sys/syscall.h> header file. */ +#define HAVE_SYS_SYSCALL_H 1 + +/* Define to 1 if you have the <sys/types.h> header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the <sys/wait.h> header file. */ +#define HAVE_SYS_WAIT_H 1 + +/* Define to 1 if compiler supports __thread */ +#define HAVE_TLS 1 + +/* Define to 1 if you have the <ucontext.h> header file. */ +#define HAVE_UCONTEXT_H 1 + +/* Define to 1 if you have the <unistd.h> header file. */ +#define HAVE_UNISTD_H 1 + +/* Define to 1 if you have the <unwind.h> header file. */ +#define HAVE_UNWIND_H 1 + +/* define if your compiler has __attribute__ */ +#define HAVE___ATTRIBUTE__ 1 + +/* Define to 1 if the system has the type `__int64'. */ +/* #undef HAVE___INT64 */ + +/* prefix where we look for installed files */ +#define INSTALL_PREFIX "/usr/local" + +/* Define to 1 if int32_t is equivalent to intptr_t */ +/* #undef INT32_EQUALS_INTPTR */ + +/* Define to 1 if your C compiler doesn't accept -c and -o together. */ +/* #undef NO_MINUS_C_MINUS_O */ + +/* Name of package */ +#define PACKAGE "google-perftools" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "opensource@google.com" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "google-perftools" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "google-perftools 1.3" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "google-perftools" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "1.3" + +/* How to access the PC from a struct ucontext */ +#define PC_FROM_UCONTEXT uc_mcontext.gregs[REG_RIP] + +/* Always the empty-string on non-windows systems. On windows, should be + "__declspec(dllexport)". This way, when we compile the dll, we export our + functions/classes. It's safe to define this here because config.h is only + used internally, to compile the DLL, and every DLL source file #includes + "config.h" before anything else. */ +#define PERFTOOLS_DLL_DECL + +/* printf format code for printing a size_t and ssize_t */ +#define PRIdS "zd" + +/* printf format code for printing a size_t and ssize_t */ +#define PRIuS "zu" + +/* printf format code for printing a size_t and ssize_t */ +#define PRIxS "zx" + +/* Define to necessary symbol if this constant uses a non-standard name on + your system. */ +/* #undef PTHREAD_CREATE_JOINABLE */ + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* the namespace where STL code like vector<> is defined */ +#define STL_NAMESPACE std + +/* Version number of package */ +#define VERSION "1.3" + +/* C99 says: define this to get the PRI... macros from stdint.h */ +#ifndef __STDC_FORMAT_MACROS +# define __STDC_FORMAT_MACROS 1 +#endif + +/* Define to `__inline__' or `__inline' if that's what the C compiler + calls it, or to nothing if 'inline' is not supported under any name. */ +#ifndef __cplusplus +/* #undef inline */ +#endif + + +#ifdef __MINGW32__ +#include "windows/mingw.h" +#endif + diff --git a/third_party/tcmalloc/config_win.h b/third_party/tcmalloc/config_win.h new file mode 100644 index 0000000..9f4efa8 --- /dev/null +++ b/third_party/tcmalloc/config_win.h @@ -0,0 +1,267 @@ +/* A manual version of config.h fit for windows machines. */ + +/* Sometimes we accidentally #include this config.h instead of the one + in .. -- this is particularly true for msys/mingw, which uses the + unix config.h but also runs code in the windows directory. + */ +#ifdef __MINGW32__ +#include "../config.h" +#define GOOGLE_PERFTOOLS_WINDOWS_CONFIG_H_ +#endif + +#ifndef GOOGLE_PERFTOOLS_WINDOWS_CONFIG_H_ +#define GOOGLE_PERFTOOLS_WINDOWS_CONFIG_H_ + +/* define this if you are linking tcmalloc statically and overriding the + * default allocators. + * For instructions on how to use this mode, see + * http://groups.google.com/group/google-perftools/browse_thread/thread/41cd3710af85e57b + */ +#define WIN32_OVERRIDE_ALLOCATORS + +/* the location of <hash_map> */ +#define HASH_MAP_H <hash_map> + +/* the namespace of hash_map/hash_set */ +#define HASH_NAMESPACE stdext + +/* the location of <hash_set> */ +#define HASH_SET_H <hash_set> + +/* Define to 1 if your libc has a snprintf implementation */ +#define HAVE_SNPRINTF + +/* Define to 1 if compiler supports __builtin_stack_pointer */ +#undef HAVE_BUILTIN_STACK_POINTER + +/* Define to 1 if you have the <conflict-signal.h> header file. */ +#undef HAVE_CONFLICT_SIGNAL_H + +/* Define to 1 if you have the declaration of `cfree', and to 0 if you don't. + */ +#undef HAVE_DECL_CFREE + +/* Define to 1 if you have the declaration of `memalign', and to 0 if you + don't. */ +#undef HAVE_DECL_MEMALIGN + +/* Define to 1 if you have the declaration of `posix_memalign', and to 0 if + you don't. */ +#undef HAVE_DECL_POSIX_MEMALIGN + +/* Define to 1 if you have the declaration of `pvalloc', and to 0 if you + don't. */ +#undef HAVE_DECL_PVALLOC + +/* Define to 1 if you have the declaration of `uname', and to 0 if you don't. + */ +#undef HAVE_DECL_UNAME + +/* Define to 1 if you have the declaration of `valloc', and to 0 if you don't. + */ +#undef HAVE_DECL_VALLOC + +/* Define to 1 if you have the <dlfcn.h> header file. */ +#undef HAVE_DLFCN_H + +/* Define to 1 if the system has the type `Elf32_Versym'. */ +#undef HAVE_ELF32_VERSYM + +/* Define to 1 if you have the <execinfo.h> header file. */ +#undef HAVE_EXECINFO_H + +/* Define to 1 if you have the <fcntl.h> header file. */ +#undef HAVE_FCNTL_H + +/* Define to 1 if you have the `geteuid' function. */ +#undef HAVE_GETEUID + +/* Define to 1 if you have the `getpagesize' function. */ +#define HAVE_GETPAGESIZE 1 /* we define it in windows/port.cc */ + +/* Define to 1 if you have the <glob.h> header file. */ +#undef HAVE_GLOB_H + +/* Define to 1 if you have the <grp.h> header file. */ +#undef HAVE_GRP_H + +/* define if the compiler has hash_map */ +#define HAVE_HASH_MAP 1 + +/* define if the compiler has hash_set */ +#define HAVE_HASH_SET 1 + +/* Define to 1 if you have the <inttypes.h> header file. */ +#undef HAVE_INTTYPES_H + +/* Define to 1 if you have the <libunwind.h> header file. */ +#undef HAVE_LIBUNWIND_H + +/* Define to 1 if you have the <linux/ptrace.h> header file. */ +#undef HAVE_LINUX_PTRACE_H + +/* Define to 1 if you have the <malloc.h> header file. */ +#undef HAVE_MALLOC_H + +/* Define to 1 if you have the <memory.h> header file. */ +#undef HAVE_MEMORY_H + +/* Define to 1 if you have a working `mmap' system call. */ +#undef HAVE_MMAP + +/* define if the compiler implements namespaces */ +#define HAVE_NAMESPACES 1 + +/* define if libc has program_invocation_name */ +#undef HAVE_PROGRAM_INVOCATION_NAME + +/* Define if you have POSIX threads libraries and header files. */ +#undef HAVE_PTHREAD + +/* Define to 1 if you have the <pwd.h> header file. */ +#undef HAVE_PWD_H + +/* Define to 1 if you have the `sbrk' function. */ +#undef HAVE_SBRK + +/* Define to 1 if you have the <stdint.h> header file. */ +#undef HAVE_STDINT_H + +/* Define to 1 if you have the <stdlib.h> header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the <strings.h> header file. */ +#undef HAVE_STRINGS_H + +/* Define to 1 if you have the <string.h> header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if the system has the type `struct mallinfo'. */ +#undef HAVE_STRUCT_MALLINFO + +/* Define to 1 if you have the <sys/prctl.h> header file. */ +#undef HAVE_SYS_PRCTL_H + +/* Define to 1 if you have the <sys/resource.h> header file. */ +#undef HAVE_SYS_RESOURCE_H + +/* Define to 1 if you have the <sys/socket.h> header file. */ +#undef HAVE_SYS_SOCKET_H + +/* Define to 1 if you have the <sys/stat.h> header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the <sys/syscall.h> header file. */ +#undef HAVE_SYS_SYSCALL_H + +/* Define to 1 if you have the <sys/types.h> header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the <sys/wait.h> header file. */ +#undef HAVE_SYS_WAIT_H + +/* Define to 1 if compiler supports __thread */ +#undef HAVE_TLS + +/* Define to 1 if you have the <ucontext.h> header file. */ +#undef HAVE_UCONTEXT_H + +/* Define to 1 if you have the <unistd.h> header file. */ +#undef HAVE_UNISTD_H + +/* Define to 1 if you have the <unwind.h> header file. */ +#undef HAVE_UNWIND_H + +/* define if your compiler has __attribute__ */ +#undef HAVE___ATTRIBUTE__ + +/* Define to 1 if the system has the type `__int64'. */ +#define HAVE___INT64 1 + +/* prefix where we look for installed files */ +#undef INSTALL_PREFIX + +/* Define to 1 if int32_t is equivalent to intptr_t */ +#undef INT32_EQUALS_INTPTR + +/* Define to 1 if your C compiler doesn't accept -c and -o together. */ +#undef NO_MINUS_C_MINUS_O + +/* Name of package */ +#undef PACKAGE + +/* Define to the address where bug reports for this package should be sent. */ +#undef PACKAGE_BUGREPORT + +/* Define to the full name of this package. */ +#undef PACKAGE_NAME + +/* Define to the full name and version of this package. */ +#undef PACKAGE_STRING + +/* Define to the one symbol short name of this package. */ +#undef PACKAGE_TARNAME + +/* Define to the version of this package. */ +#undef PACKAGE_VERSION + +/* How to access the PC from a struct ucontext */ +#undef PC_FROM_UCONTEXT + +/* Always the empty-string on non-windows systems. On windows, should be + "__declspec(dllexport)". This way, when we compile the dll, we export our + functions/classes. It's safe to define this here because config.h is only + used internally, to compile the DLL, and every DLL source file #includes + "config.h" before anything else. */ +#ifndef PERFTOOLS_DLL_DECL +# define PERFTOOLS_IS_A_DLL 1 /* not set if you're statically linking */ +# define PERFTOOLS_DLL_DECL __declspec(dllexport) +# define PERFTOOLS_DLL_DECL_FOR_UNITTESTS __declspec(dllimport) +#endif + +/* printf format code for printing a size_t and ssize_t */ +#define PRIdS "Id" + +/* printf format code for printing a size_t and ssize_t */ +#define PRIuS "Iu" + +/* printf format code for printing a size_t and ssize_t */ +#define PRIxS "Ix" + +/* Define to necessary symbol if this constant uses a non-standard name on + your system. */ +#undef PTHREAD_CREATE_JOINABLE + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* the namespace where STL code like vector<> is defined */ +#define STL_NAMESPACE std + +/* Version number of package */ +#undef VERSION + +/* C99 says: define this to get the PRI... macros from stdint.h */ +#ifndef __STDC_FORMAT_MACROS +# define __STDC_FORMAT_MACROS 1 +#endif + +/* Define to `__inline__' or `__inline' if that's what the C compiler + calls it, or to nothing if 'inline' is not supported under any name. */ +#ifndef __cplusplus +#undef inline +#endif + +// --------------------------------------------------------------------- +// Extra stuff not found in config.h.in + +// This must be defined before the windows.h is included. It's needed +// for mutex.h, to give access to the TryLock method. +#ifndef _WIN32_WINNT +# define _WIN32_WINNT 0x0400 +#endif + +// TODO(csilvers): include windows/port.h in every relevant source file instead? +#include "windows/port.h" + +#endif /* GOOGLE_PERFTOOLS_WINDOWS_CONFIG_H_ */ diff --git a/third_party/tcmalloc/tcmalloc.gyp b/third_party/tcmalloc/tcmalloc.gyp index 43fc60d..99bc266 100644 --- a/third_party/tcmalloc/tcmalloc.gyp +++ b/third_party/tcmalloc/tcmalloc.gyp @@ -19,6 +19,7 @@ 'tcmalloc/src/windows', 'tcmalloc/src/base', 'tcmalloc/src', + '../..', ], 'direct_dependent_settings': { 'msvs_settings': { @@ -31,23 +32,43 @@ }, }, 'sources': [ + 'config.h', + 'config_linux.h', + 'config_win.h', 'tcmalloc/src/base/dynamic_annotations.cc', + 'tcmalloc/src/base/dynamic_annotations.h', 'tcmalloc/src/base/logging.cc', + 'tcmalloc/src/base/logging.h', 'tcmalloc/src/base/low_level_alloc.cc', + 'tcmalloc/src/base/low_level_alloc.h', 'tcmalloc/src/base/spinlock.cc', + 'tcmalloc/src/base/spinlock.h', 'tcmalloc/src/base/sysinfo.cc', + 'tcmalloc/src/base/sysinfo.h', + 'tcmalloc/src/base/vdso_support.cc', + 'tcmalloc/src/base/vdso_support.h', 'tcmalloc/src/central_freelist.cc', + 'tcmalloc/src/central_freelist.h', 'tcmalloc/src/common.cc', + 'tcmalloc/src/common.h', 'tcmalloc/src/heap-profile-table.cc', + 'tcmalloc/src/heap-profile-table.h', 'tcmalloc/src/internal_logging.cc', + 'tcmalloc/src/internal_logging.h', 'tcmalloc/src/malloc_extension.cc', 'tcmalloc/src/malloc_hook.cc', + 'tcmalloc/src/maybe_threads.cc', + 'tcmalloc/src/maybe_threads.h', 'tcmalloc/src/page_heap.cc', 'tcmalloc/src/sampler.cc', 'tcmalloc/src/span.cc', 'tcmalloc/src/stack_trace_table.cc', 'tcmalloc/src/stacktrace.cc', 'tcmalloc/src/static_vars.cc', + 'tcmalloc/src/system-alloc.cc', + 'tcmalloc/src/system-alloc.h', + 'tcmalloc/src/tcmalloc.cc', + 'tcmalloc/src/tcmalloc.h', 'tcmalloc/src/thread_cache.cc', 'tcmalloc/src/windows/override_functions.cc', 'tcmalloc/src/windows/port.cc', @@ -72,6 +93,25 @@ }, }, }, + 'conditions': [ + ['OS=="win"', { + 'sources!': [ + 'tcmalloc/src/base/vdso_support.cc', + 'tcmalloc/src/base/vdso_support.h', + 'tcmalloc/src/maybe_threads.cc', + 'tcmalloc/src/maybe_threads.h', + 'tcmalloc/src/system-alloc.cc', + 'tcmalloc/src/system-alloc.h', + 'tcmalloc/src/tcmalloc.cc', + 'tcmalloc/src/tcmalloc.h', + ], + }, { # else: 'OS!="win"' + 'sources!': [ + 'tcmalloc/src/windows/override_functions.cc', + 'tcmalloc/src/windows/port.cc', + ], + }], + ], }, { 'target_name': 'libcmt', |