Bug 1401662 - don't inline nsThreadManager::get(); r=erahm

Defining get() in the declaration of nsThreadManager implicitly sticks
an "inline" on the function, which is not what we want: inlining it
spreads around a lot of static initialization code.  Providing an
out-of-line definition is much better in terms of code size.
This commit is contained in:
Nathan Froyd 2017-09-20 17:10:20 -04:00
Родитель eb8ee79616
Коммит 3393422869
2 изменённых файлов: 8 добавлений и 5 удалений

Просмотреть файл

@ -105,6 +105,13 @@ NS_IMPL_CI_INTERFACE_GETTER(nsThreadManager, nsIThreadManager)
//-----------------------------------------------------------------------------
/*static*/ nsThreadManager&
nsThreadManager::get()
{
static nsThreadManager sInstance;
return sInstance;
}
nsresult
nsThreadManager::Init()
{

Просмотреть файл

@ -20,11 +20,7 @@ public:
NS_DECL_ISUPPORTS
NS_DECL_NSITHREADMANAGER
static nsThreadManager& get()
{
static nsThreadManager sInstance;
return sInstance;
}
static nsThreadManager& get();
nsresult Init();