lune/tests/ffi/ref-hold-box.luau
2024-10-13 05:09:31 +00:00

15 lines
253 B
Text

--!nocheck
--!nolint
local ffi = require("@lune/ffi")
local box = ffi.box(ffi.i32.size)
local ref = box:ref()
local wt = setmetatable({}, { __mode = "v" })
wt[1] = box
box = nll
collectgarbage("collect")
assert(wt[1] ~= nil, "ref hold box failed")