Skip to content

Instantly share code, notes, and snippets.

@Shishqa
Created August 24, 2021 14:22
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