summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorJude Melton-Houghton <jwmhjwmh@gmail.com>2021-12-19 08:41:08 -0500
committersfan5 <sfan5@live.de>2021-12-19 17:03:07 +0100
commit1b664dd87084ec8614371ea951791b10533b83c2 (patch)
tree40a0ada6d334949012fc90d534ba557f586bb12f /builtin
parent49f7d2494ce178162a96da57315ad41f6c2796c6 (diff)
downloadminetest-1b664dd87084ec8614371ea951791b10533b83c2.tar.gz
minetest-1b664dd87084ec8614371ea951791b10533b83c2.tar.bz2
minetest-1b664dd87084ec8614371ea951791b10533b83c2.zip
Use defined evaluation order in profiler
See https://github.com/LuaJIT/LuaJIT/issues/238
Diffstat (limited to 'builtin')
-rw-r--r--builtin/profiler/instrumentation.lua5
1 files changed, 3 insertions, 2 deletions
diff --git a/builtin/profiler/instrumentation.lua b/builtin/profiler/instrumentation.lua
index 6b951a2c2..f80314b32 100644
--- a/builtin/profiler/instrumentation.lua
+++ b/builtin/profiler/instrumentation.lua
@@ -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