diff options
author | thakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-05-15 23:24:17 +0000 |
---|---|---|
committer | thakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-05-15 23:24:17 +0000 |
commit | d0dd7e64639cdf0c8f6e137b58f575599aca9942 (patch) | |
tree | bb3d2f164c8b0404262a4ba03d62db6a0130bf0e /third_party/tcmalloc/chromium/src | |
parent | 36a49fcf48cfe7b1550e5d7e590acb8f848f2bec (diff) | |
download | chromium_src-d0dd7e64639cdf0c8f6e137b58f575599aca9942.zip chromium_src-d0dd7e64639cdf0c8f6e137b58f575599aca9942.tar.gz chromium_src-d0dd7e64639cdf0c8f6e137b58f575599aca9942.tar.bz2 |
Don't let tcmalloc read all kinds of env vars at startup.
The env vars are still used in profiling=1 builds, by such
illustrious figures as the deep memory profiler bot and
willchan. Reading from the environment variables uses static
initializers, so this change will eliminate those static
initializers in profiling=0 builds.
As discussed in the chromium-dev thread
"Does anyone use tcmalloc's debugging envvars?".
BUG=94925
NOTRY=true
Review URL: https://codereview.chromium.org/281613004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@270850 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'third_party/tcmalloc/chromium/src')
-rw-r--r-- | third_party/tcmalloc/chromium/src/base/commandlineflags.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/third_party/tcmalloc/chromium/src/base/commandlineflags.h b/third_party/tcmalloc/chromium/src/base/commandlineflags.h index 649b95f..6d41e86 100644 --- a/third_party/tcmalloc/chromium/src/base/commandlineflags.h +++ b/third_party/tcmalloc/chromium/src/base/commandlineflags.h @@ -119,6 +119,8 @@ // They are functions in Android because __system_property_get() doesn't // return a string. +#if defined(ENABLE_PROFILING) + #if defined(__ANDROID__) || defined(ANDROID) // Returns a pointer to a static variable. The string pointed by the returned @@ -178,4 +180,14 @@ inline double EnvToDouble(const char* envname, double dflt) { #endif // defined(__ANDROID__) || defined(ANDROID) +#else // defined(ENABLE_PROFILING) + +#define EnvToString(envname, dflt) (dflt) +#define EnvToBool(envname, dflt) (dflt) +#define EnvToInt(envname, dflt) (dflt) +#define EnvToInt64(envname, dflt) (dflt) +#define EnvToDouble(envname, dflt) (dflt) + +#endif // defined(ENABLE_PROFILING) + #endif // BASE_COMMANDLINEFLAGS_H_ |