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/newview/llviewercamera.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'indra/newview/llviewercamera.h') diff --git a/indra/newview/llviewercamera.h b/indra/newview/llviewercamera.h index 2b8a0892bf..01fa86d7c5 100644 --- a/indra/newview/llviewercamera.h +++ b/indra/newview/llviewercamera.h @@ -52,6 +52,9 @@ const F32 OGL_TO_CFR_ROTATION[16] = { 0.f, 0.f, -1.f, 0.f, // -Z becomes X const BOOL FOR_SELECTION = TRUE; const BOOL NOT_FOR_SELECTION = FALSE; +// Build time optimization, generate this once in .cpp file +extern template class LLViewerCamera* LLSingleton::getInstance(); + class LLViewerCamera : public LLCamera, public LLSingleton { public: -- 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/newview/llviewercamera.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llviewercamera.h') diff --git a/indra/newview/llviewercamera.h b/indra/newview/llviewercamera.h index 01fa86d7c5..bf561c3e4d 100644 --- a/indra/newview/llviewercamera.h +++ b/indra/newview/llviewercamera.h @@ -53,7 +53,7 @@ const BOOL FOR_SELECTION = TRUE; const BOOL NOT_FOR_SELECTION = FALSE; // Build time optimization, generate this once in .cpp file -extern template class LLViewerCamera* LLSingleton::getInstance(); +//extern template class LLViewerCamera* LLSingleton::getInstance(); class LLViewerCamera : public LLCamera, 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/newview/llviewercamera.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'indra/newview/llviewercamera.h') diff --git a/indra/newview/llviewercamera.h b/indra/newview/llviewercamera.h index bf561c3e4d..cd67af5fef 100644 --- a/indra/newview/llviewercamera.h +++ b/indra/newview/llviewercamera.h @@ -53,7 +53,9 @@ const BOOL FOR_SELECTION = TRUE; const BOOL NOT_FOR_SELECTION = FALSE; // Build time optimization, generate this once in .cpp file -//extern template class LLViewerCamera* LLSingleton::getInstance(); +#ifndef LLVIEWERCAMERA_CPP +extern template class LLViewerCamera* LLSingleton::getInstance(); +#endif class LLViewerCamera : public LLCamera, public LLSingleton { -- cgit v1.2.3