lune/tests/ffi/free.luau
2024-11-09 10:07:26 +00:00

18 lines
296 B
Text

--!nocheck
--!nolint
local ffi = require("@lune/ffi")
local box = ffi.box(ffi.i32.size)
local ref = box:leak()
box = nil
collectgarbage("collect")
collectgarbage("collect")
collectgarbage("collect")
ffi.free(ref)
collectgarbage("collect")
collectgarbage("collect")
collectgarbage("collect")