-
Notifications
You must be signed in to change notification settings - Fork 386
Closed
Description
Some kinds of cdata are counted improperly (i.e. are not counted).
How to reproduce:
Assume we have a file named <cdatanum.lua> with the following code:
local ffi = require "ffi"
local function collected() print"collected" end
collectgarbage()
print("before", misc.getmetrics().gc_cdatanum)
ffi.gc(ffi.cast("void *", 0), collected)
collectgarbage()
collectgarbage()
print("after", misc.getmetrics().gc_cdatanum)
Output:
$ src/luajit cdatanum.lua
before 0
collected
after -1