So I have the following class:
#define SINGLETON Singleton::GetInstance()
//#define MY_MACRO(X) Singleton::RunS(X)
//#define MY_MACRO(X) SINGLETON->Run(X)
class Singleton;
using Singleton_ptr = std::shared_ptr < Singleton > ;
class Singleton
{
public:
static Singleton_ptr GetInstance();
static wstring RunS(__in const wstring& strSource) { return SINGLETON->Run(strSource); }
public:
void Run(__in const wstring& strSource);
private:
static Singleton_ptr ms_Instance;
Singleton();
};
You can see that the I have two different ways of defining MY_MACRO
.
#define MY_MACRO(X) Singleton::RunS(X)
. AKA - def1#define MY_MACRO(X) SINGLETON->Run(X)
. AKA - def2
MY_MACRO
macro is used ~2000 times in my entire solution.
It appears that the way I'm defining MY_MACRO
has a significant impact on my executable sizes. def2 generate much bigger executables (increase by 120KB) then def1.
Questions
- Can anyone explain why this simple difference in the macro definition change the excusable sizes?
- Is there an optimal way of defining
MY_MACRO
to minimize excusable sizes?
Aucun commentaire:
Enregistrer un commentaire