aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llappviewerwin32.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2009-11-19 04:19:06 -0600
committerJacek Antonelli2009-11-19 04:19:06 -0600
commit1d443b7a94ed6f9ef1d408caef72fcbc0b1ee427 (patch)
treee09ccbc010e326a48fd91ba15b58afd7fb836b3f /linden/indra/newview/llappviewerwin32.cpp
parentFixed minor formatting issue in MANIFESTO.txt. (diff)
parentFixed CMake setting errors (diff)
downloadmeta-impy-1d443b7a94ed6f9ef1d408caef72fcbc0b1ee427.zip
meta-impy-1d443b7a94ed6f9ef1d408caef72fcbc0b1ee427.tar.gz
meta-impy-1d443b7a94ed6f9ef1d408caef72fcbc0b1ee427.tar.bz2
meta-impy-1d443b7a94ed6f9ef1d408caef72fcbc0b1ee427.tar.xz
Merge remote branch 'mccabe/1.3.0-next' into next
Conflicts: linden/indra/cmake/00-Common.cmake linden/indra/newview/skins/default/xui/de/floater_about.xml linden/indra/newview/skins/default/xui/fr/floater_about.xml linden/indra/newview/skins/default/xui/ja/floater_about.xml linden/indra/newview/skins/default/xui/ko/floater_about.xml linden/indra/newview/skins/default/xui/zh/floater_about.xml linden/install.xml
Diffstat (limited to 'linden/indra/newview/llappviewerwin32.cpp')
-rw-r--r--linden/indra/newview/llappviewerwin32.cpp67
1 files changed, 64 insertions, 3 deletions
diff --git a/linden/indra/newview/llappviewerwin32.cpp b/linden/indra/newview/llappviewerwin32.cpp
index 110364d..87be31a 100644
--- a/linden/indra/newview/llappviewerwin32.cpp
+++ b/linden/indra/newview/llappviewerwin32.cpp
@@ -17,7 +17,8 @@
17 * There are special exceptions to the terms and conditions of the GPL as 17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception 18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or 19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception 20 * online at
21 * http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 * 22 *
22 * By copying, modifying or distributing this software, you acknowledge 23 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above, 24 * that you have read and understood your obligations described above,
@@ -77,6 +78,31 @@ extern "C" {
77#endif 78#endif
78#endif 79#endif
79 80
81// Force Imprudence to link against the correct boost libraries -- McCabe
82#if defined(_MSC_VER)
83#if _MSC_VER >= 1500
84#ifdef LL_DEBUG
85#pragma comment( lib, "libboost_signals-vc90-mt-gd-1_36.lib" )
86#pragma comment( lib, "libboost_regex-vc90-mt-gd-1_36.lib" )
87#pragma comment( lib, "libboost_program_options-vc90-mt-gd-1_36.lib" )
88#else
89#pragma comment( lib, "libboost_signals-vc90-mt-1_36.lib" )
90#pragma comment( lib, "libboost_regex-vc90-mt-1_36.lib" )
91#pragma comment( lib, "libboost_program_options-vc90-mt-1_36.lib" )
92#endif
93#elif _MSC_VER >= 1400
94#ifdef LL_DEBUG
95#pragma comment( lib, "libboost_signals-vc80-mt-gd-1_36.lib" )
96#pragma comment( lib, "libboost_regex-vc80-mt-gd-1_36.lib" )
97#pragma comment( lib, "libboost_program_options-vc80-mt-gd-1_36.lib" )
98#else
99#pragma comment( lib, "libboost_signals-vc80-mt-1_36.lib" )
100#pragma comment( lib, "libboost_regex-vc80-mt-1_36.lib" )
101#pragma comment( lib, "libboost_program_options-vc80-mt-1_36.lib" )
102#endif
103#endif
104#endif
105
80const std::string LLAppViewerWin32::sWindowClass = "Second Life"; 106const std::string LLAppViewerWin32::sWindowClass = "Second Life";
81 107
82LONG WINAPI viewer_windows_exception_handler(struct _EXCEPTION_POINTERS *exception_infop) 108LONG WINAPI viewer_windows_exception_handler(struct _EXCEPTION_POINTERS *exception_infop)
@@ -158,9 +184,31 @@ int APIENTRY WINMAIN(HINSTANCE hInstance,
158 int nCmdShow) 184 int nCmdShow)
159{ 185{
160 LLMemType mt1(LLMemType::MTYPE_STARTUP); 186 LLMemType mt1(LLMemType::MTYPE_STARTUP);
187
188 const S32 MAX_HEAPS = 255;
189 DWORD heap_enable_lfh_error[MAX_HEAPS];
190 S32 num_heaps = 0;
161 191
162#if WINDOWS_CRT_MEM_CHECKS && !INCLUDE_VLD 192#if WINDOWS_CRT_MEM_CHECKS && !INCLUDE_VLD
163 _CrtSetDbgFlag ( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF ); // dump memory leaks on exit 193 _CrtSetDbgFlag ( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF ); // dump memory leaks on exit
194#elif 1
195 // Experimental - enable the low fragmentation heap
196 // This results in a 2-3x improvement in opening a new Inventory window (which uses a large numebr of allocations)
197 // Note: This won't work when running from the debugger unless the _NO_DEBUG_HEAP environment variable is set to 1
198
199 _CrtSetDbgFlag(0); // default, just making explicit
200
201 ULONG ulEnableLFH = 2;
202 HANDLE* hHeaps = new HANDLE[MAX_HEAPS];
203 num_heaps = GetProcessHeaps(MAX_HEAPS, hHeaps);
204 for(S32 i = 0; i < num_heaps; i++)
205 {
206 bool success = HeapSetInformation(hHeaps[i], HeapCompatibilityInformation, &ulEnableLFH, sizeof(ulEnableLFH));
207 if (success)
208 heap_enable_lfh_error[i] = 0;
209 else
210 heap_enable_lfh_error[i] = GetLastError();
211 }
164#endif 212#endif
165 213
166 // *FIX: global 214 // *FIX: global
@@ -182,8 +230,21 @@ int APIENTRY WINMAIN(HINSTANCE hInstance,
182 llwarns << "Application init failed." << llendl; 230 llwarns << "Application init failed." << llendl;
183 return -1; 231 return -1;
184 } 232 }
185 233
186 // Run the application main loop 234 // Have to wait until after logging is initialized to display LFH info
235 if (num_heaps > 0)
236 {
237 llinfos << "Attempted to enable LFH for " << num_heaps << " heaps." << llendl;
238 for(S32 i = 0; i < num_heaps; i++)
239 {
240 if (heap_enable_lfh_error[i])
241 {
242 llinfos << " Failed to enable LFH for heap: " << i << " Error: " << heap_enable_lfh_error[i] << llendl;
243 }
244 }
245 }
246
247 // Run the application main loop
187 if(!LLApp::isQuitting()) 248 if(!LLApp::isQuitting())
188 { 249 {
189 viewer_app_ptr->mainLoop(); 250 viewer_app_ptr->mainLoop();