From f280c43d616d013747a9aab05141635868e00136 Mon Sep 17 00:00:00 2001 From: James Cook Date: Sat, 28 Nov 2009 16:51:02 -0800 Subject: Use extern template for common singletons to reduce code bloat/link time. --- indra/llui/lluictrlfactory.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'indra/llui/lluictrlfactory.h') diff --git a/indra/llui/lluictrlfactory.h b/indra/llui/lluictrlfactory.h index 8a9c9e23c1..adb3f7202f 100644 --- a/indra/llui/lluictrlfactory.h +++ b/indra/llui/lluictrlfactory.h @@ -108,6 +108,9 @@ extern LLFastTimer::DeclareTimer FTM_WIDGET_SETUP; extern LLFastTimer::DeclareTimer FTM_WIDGET_CONSTRUCTION; extern LLFastTimer::DeclareTimer FTM_INIT_FROM_PARAMS; +// Build time optimization, generate this once in .cpp file +extern template class LLUICtrlFactory* LLSingleton::getInstance(); + class LLUICtrlFactory : public LLSingleton { private: -- cgit v1.2.3 From b50ba67bd8ab329d598ce47e5d3ac09b59fffb63 Mon Sep 17 00:00:00 2001 From: James Cook Date: Sun, 29 Nov 2009 10:19:17 -0800 Subject: Revert extern template link optimization until I can build/test on PC --- indra/llui/lluictrlfactory.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llui/lluictrlfactory.h') diff --git a/indra/llui/lluictrlfactory.h b/indra/llui/lluictrlfactory.h index adb3f7202f..e021c04ad6 100644 --- a/indra/llui/lluictrlfactory.h +++ b/indra/llui/lluictrlfactory.h @@ -109,7 +109,7 @@ extern LLFastTimer::DeclareTimer FTM_WIDGET_CONSTRUCTION; extern LLFastTimer::DeclareTimer FTM_INIT_FROM_PARAMS; // Build time optimization, generate this once in .cpp file -extern template class LLUICtrlFactory* LLSingleton::getInstance(); +//extern template class LLUICtrlFactory* LLSingleton::getInstance(); class LLUICtrlFactory : public LLSingleton { -- cgit v1.2.3 From 7d3b3cc474822db144b623980d08b7addc2f77ff Mon Sep 17 00:00:00 2001 From: James Cook Date: Mon, 30 Nov 2009 14:41:52 -0800 Subject: Linker optimization - use "extern template" for commonly regenerated templates Also replaced many duplicate calls to LLViewerCamera::getInstance() with local pointer. Reviewed with Ambroff --- indra/llui/lluictrlfactory.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'indra/llui/lluictrlfactory.h') diff --git a/indra/llui/lluictrlfactory.h b/indra/llui/lluictrlfactory.h index e021c04ad6..55d7d745eb 100644 --- a/indra/llui/lluictrlfactory.h +++ b/indra/llui/lluictrlfactory.h @@ -109,7 +109,9 @@ extern LLFastTimer::DeclareTimer FTM_WIDGET_CONSTRUCTION; extern LLFastTimer::DeclareTimer FTM_INIT_FROM_PARAMS; // Build time optimization, generate this once in .cpp file -//extern template class LLUICtrlFactory* LLSingleton::getInstance(); +#ifndef LLUICTRLFACTORY_CPP +extern template class LLUICtrlFactory* LLSingleton::getInstance(); +#endif class LLUICtrlFactory : public LLSingleton { -- cgit v1.2.3