Skip to content

Commit

Permalink
Add placeholder profiler.script.
Browse files Browse the repository at this point in the history
  • Loading branch information
Neloreck committed Jan 15, 2025
1 parent b9e576f commit d7785c1
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
11 changes: 11 additions & 0 deletions res/gamedata/scripts/profiler.script
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
-- Original profiler was not working and caused game to crash when jit parameter is disabled.
-- For safety reasons there is mock setup function and empty module without original code.
--
-- 1) LUA does not allow setting up multiple hooks, adding hooks here instead of C++ codebase is problematic
-- 2) Luabind/Luajit already injects complex logics, C++ codebase adds error callbacks and custom logics.
-- As result, stack and state may be corrupted and cause random logics/memory errors.
--
-- See: https://github.com/OpenXRay/xray-16/issues/1436

-- Mock placeholder.
function setup_hook() end
4 changes: 2 additions & 2 deletions src/xrScriptEngine/script_profiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ void CScriptProfiler::stop()
m_active = false;
}

void CScriptProfiler::reset()
{
void CScriptProfiler::reset()
{
Msg("Reset profiler");

m_profiling_portions.clear();
Expand Down

0 comments on commit d7785c1

Please sign in to comment.