Bug 1406440 - don't inline nsSMILNullType::Singleton(); r=dholbert

Defining Singleton() in the declaration of nsSMILNullType 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-10-09 10:39:38 -04:00
Родитель b2711ec3e9
Коммит 3e4ac652e8
2 изменённых файлов: 8 добавлений и 6 удалений

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

@ -8,6 +8,13 @@
#include "nsSMILValue.h"
#include "nsDebug.h"
/*static*/ nsSMILNullType*
nsSMILNullType::Singleton()
{
static nsSMILNullType sSingleton;
return &sSingleton;
}
nsresult
nsSMILNullType::Assign(nsSMILValue& aDest, const nsSMILValue& aSrc) const
{

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

@ -14,12 +14,7 @@ class nsSMILNullType : public nsISMILType
{
public:
// Singleton for nsSMILValue objects to hold onto.
static nsSMILNullType*
Singleton()
{
static nsSMILNullType sSingleton;
return &sSingleton;
}
static nsSMILNullType* Singleton();
protected:
// nsISMILType Methods