Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local mode = ...
- mode = mode and tonumber(mode) or 1
- local ffi = require 'ffi'
- ffi.cdef 'struct ss{ int i ; }'
- local ss_t = ffi.typeof('struct ss')
- local noop = function(t) end
- if mode == 1 then
- local mtt = {__gc=noop}
- ffi.metatype(ss_t, mtt)
- end
- for i=1,20000000 do
- if mode == 1 then
- local g = ffi.new(ss_t)
- elseif mode == 2 then
- local g = ffi.new(ss_t)
- ffi.gc(g, noop)
- elseif mode == 3 then
- local g = ffi.new(ss_t)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement