Bug 1510113 - Never inline SaveToEnv or SaveWordToEnv. r=karlt
authorThomas Daede <tdaede@mozilla.com>
Wed, 28 Nov 2018 03:10:55 +0000
changeset 504900 d085db32a53d617676be6f855063d1499dbb1d71
parent 504899 3d6e1fe4c371780a6bfcd9c33adce87dd4f38fc6
child 504901 bba74d02a136e322e179e738632be392ee8b2ede
push id10290
push userffxbld-merge
push dateMon, 03 Dec 2018 16:23:23 +0000
treeherdermozilla-beta@700bed2445e6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskarlt
bugs1510113
milestone65.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1510113 - Never inline SaveToEnv or SaveWordToEnv. r=karlt This allows Valgrind to recognize the call stacks to this function, avoiding Valgrind warnings in intentional leaks in these functions. Differential Revision: https://phabricator.services.mozilla.com/D13036
toolkit/xre/CmdLineAndEnvUtils.h
toolkit/xre/nsAppRunner.cpp
--- a/toolkit/xre/CmdLineAndEnvUtils.h
+++ b/toolkit/xre/CmdLineAndEnvUtils.h
@@ -389,17 +389,17 @@ SetArgv0ToFullBinaryPath(wchar_t* aArgv[
   aArgv[0] = newArgv_0.release();
   MOZ_LSAN_INTENTIONALLY_LEAK_OBJECT(aArgv[0]);
   return true;
 }
 
 #endif // defined(XP_WIN)
 
 // Save literal putenv string to environment variable.
-inline void
+MOZ_NEVER_INLINE inline void
 SaveToEnv(const char *aEnvString)
 {
 #if defined(MOZILLA_INTERNAL_API)
   char *expr = strdup(aEnvString);
   if (expr) {
     PR_SetEnv(expr);
   }
 
--- a/toolkit/xre/nsAppRunner.cpp
+++ b/toolkit/xre/nsAppRunner.cpp
@@ -314,17 +314,17 @@ using namespace mozilla;
 using namespace mozilla::startup;
 using mozilla::Unused;
 using mozilla::scache::StartupCache;
 using mozilla::dom::ContentParent;
 using mozilla::dom::ContentChild;
 using mozilla::intl::LocaleService;
 
 // Save the given word to the specified environment variable.
-static void
+static void MOZ_NEVER_INLINE
 SaveWordToEnv(const char *name, const nsACString & word)
 {
   char *expr = Smprintf("%s=%s", name, PromiseFlatCString(word).get()).release();
   if (expr)
     PR_SetEnv(expr);
   // We intentionally leak |expr| here since it is required by PR_SetEnv.
 }