Cool VL Viewer forum
http://sldev.free.fr/forum/

Reduce checks for hijacked last chance exception handler
http://sldev.free.fr/forum/viewtopic.php?f=10&t=2075
Page 1 of 1

Author:  kathrine [ 2020-10-07 23:41:16 ]
Post subject:  Reduce checks for hijacked last chance exception handler

The checkExceptionHandler() call isn't super cheap (around 0.5% CPU time on the rendering thread according to the VS profiler).

It should be good enough to only check periodically and not every single frame.

Code:
--- linden_orig/indra/newview/llappviewerwin32.cpp   Fri Jul  3 00:45:28 2020
+++ linden/indra/newview/llappviewerwin32.cpp   Wed Oct  7 23:32:28 2020
@@ -1482,11 +1482,17 @@
    return IsDebuggerPresent();
 }
 
 bool LLAppViewerWin32::restoreErrorTrap()
 {
-   return LLWinDebug::checkExceptionHandler();
+   static int call_count = 0;
+   call_count += 1;
+   if (call_count % 120 == 0) {
+      call_count = 0;
+      return LLWinDebug::checkExceptionHandler();
+   }
+   return true;
 }
 
 void LLAppViewerWin32::handleSyncCrashTrace()
 {
    // Free our reserved memory space before dumping the stack trace

Author:  Henri Beauchamp [ 2020-10-08 12:00:15 ]
Post subject:  Re: Reduce checks for hijacked last chance exception handler

Indeed... Checking every second or so will be enough. Implemented (with gFrameTimeSeconds) for next releases.

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/