examples/luastate.lua

changeset 10
cafaa46928c8
parent 9
cefa0be5f567
child 11
1e2c945346ca
equal deleted inserted replaced
9:cefa0be5f567 10:cafaa46928c8
96 96
97 ltraverse.traverse(funcs, ignores) 97 ltraverse.traverse(funcs, ignores)
98 98
99 local fd = file 99 local fd = file
100 if type(file) == 'string' then 100 if type(file) == 'string' then
101 fd = io.open(filename, "w") 101 fd = io.open(file, "w")
102 end 102 end
103 fd:write(sformat("memory = %i bytes\n", collectgarbage"count" * 1024)) 103 fd:write(sformat("memory = %i bytes\n", collectgarbage"count" * 1024))
104 fd:write(sformat("str_data = %i\n", str_data)) 104 fd:write(sformat("str_data = %i\n", str_data))
105 fd:write(sformat("object type counts:\n")) 105 fd:write(sformat("object type counts:\n"))
106 for t,cnt in pairs(type_cnts) do 106 for t,cnt in pairs(type_cnts) do

mercurial