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

Unified Diff: third_party/tcmalloc/chromium/src/base/commandlineflags.h

Issue 842673002: [tcmalloc]: Remove calls to __system_property_get in tcmalloc. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
« no previous file with comments | « third_party/tcmalloc/README.chromium ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/tcmalloc/chromium/src/base/commandlineflags.h
diff --git a/third_party/tcmalloc/chromium/src/base/commandlineflags.h b/third_party/tcmalloc/chromium/src/base/commandlineflags.h
index 614be3a1a6bca90ebd621793f0c8c4033a5f7727..cfb03769082cb91ee09ce63f83de3c130d3bd7ae 100644
--- a/third_party/tcmalloc/chromium/src/base/commandlineflags.h
+++ b/third_party/tcmalloc/chromium/src/base/commandlineflags.h
@@ -54,10 +54,6 @@
#include <stdlib.h> // for getenv
#include "base/basictypes.h"
-#if defined(__ANDROID__) || defined(ANDROID)
-#include <sys/system_properties.h>
-#endif
-
#define DECLARE_VARIABLE(type, name) \
namespace FLAG__namespace_do_not_use_directly_use_DECLARE_##type##_instead {\
extern PERFTOOLS_DLL_DECL type FLAGS_##name; \
@@ -115,52 +111,11 @@
// These macros (could be functions, but I don't want to bother with a .cc
// file), make it easier to initialize flags from the environment.
-// 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
-// pointer must not be modified.
-inline const char* const EnvToString(const char* envname, const char* dflt) {
- static char system_property_value[PROP_VALUE_MAX];
- if (__system_property_get(envname, system_property_value) > 0)
- return system_property_value;
- return dflt;
-}
-
-inline bool EnvToBool(const char* envname, bool dflt) {
- static const char kTrueValues[] = "tTyY1";
- char system_property_value[PROP_VALUE_MAX];
- if (__system_property_get(envname, system_property_value) > 0)
- return memchr(kTrueValues, system_property_value[0], sizeof(kTrueValues));
- return dflt;
-}
-
-inline int EnvToInt(const char* envname, int dflt) {
- char system_property_value[PROP_VALUE_MAX];
- if (__system_property_get(envname, system_property_value) > 0)
- return strtol(system_property_value, NULL, 10);
- return dflt;
-}
-
-inline int64 EnvToInt64(const char* envname, int64 dflt) {
- char system_property_value[PROP_VALUE_MAX];
- if (__system_property_get(envname, system_property_value) > 0)
- return strtoll(system_property_value, NULL, 10);
- return dflt;
-}
-
-inline double EnvToDouble(const char* envname, double dflt) {
- char system_property_value[PROP_VALUE_MAX];
- if (__system_property_get(envname, system_property_value) > 0)
- return strtod(system_property_value, NULL);
- return dflt;
-}
-
-#else // defined(__ANDROID__) || defined(ANDROID)
+#error TCMalloc does not support profiling on Android
jar (doing other things) 2015/01/07 19:39:57 I'm missing the connection to TCMalloc. You are r
jar (doing other things) 2015/01/07 20:28:20 <DOH!> I misread the file name (I stopped looking
#define EnvToString(envname, dflt) \
(!getenv(envname) ? (dflt) : getenv(envname))
« no previous file with comments | « third_party/tcmalloc/README.chromium ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698