]> git.lizzy.rs Git - dragonfireclient.git/commitdiff
Use defined evaluation order in profiler
authorJude Melton-Houghton <jwmhjwmh@gmail.com>
Sun, 19 Dec 2021 13:41:08 +0000 (08:41 -0500)
committersfan5 <sfan5@live.de>
Sun, 19 Dec 2021 16:03:07 +0000 (17:03 +0100)
See https://github.com/LuaJIT/LuaJIT/issues/238

builtin/profiler/instrumentation.lua

index 6b951a2c2d57647b3068e531b27213a128566bfb..f80314b3283166bc8fa5bc5bf4a9ddaf8ce2d8c2 100644 (file)
@@ -102,8 +102,9 @@ local function instrument(def)
                -- also called https://en.wikipedia.org/wiki/Continuation_passing_style
                -- Compared to table creation and unpacking it won't lose `nil` returns
                -- and is expected to be faster
-               -- `measure` will be executed after time() and func(...)
-               return measure(modname, instrument_name, time(), func(...))
+               -- `measure` will be executed after func(...)
+               local start = time()
+               return measure(modname, instrument_name, start, func(...))
        end
 end