Created
August 24, 2021 14:22
-
-
Save Shishqa/9753063a258e38520d3c2f09d18378a5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local table_new = require "table.new" | |
local function payload() | |
local _ = table_new(10, 0) | |
for i = 1, 10 do | |
_[i] = "memprof-str-"..i | |
end | |
_ = nil | |
collectgarbage() | |
end | |
-- 5 allocations from interp and 5 allocations | |
-- from the trace. | |
jit.opt.start(3, "hotloop=4") | |
jit.flush() | |
for _ = 1, 100500 do | |
payload() | |
-- Force JIT to regenerate the trace and create | |
-- new symtab entry. | |
jit.flush() | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment