Added a call to collectgarbage, it doesn't print the log message on first time. After every additional call it prints the message.
Could you show your code?
I started testing bound checking in cBlockArea. Here the small code:
Code:
function Initialize(Plugin)
Plugin:SetName( "TestPlugin" )
Plugin:SetVersion( 1 )
cPluginManager:BindConsoleCommand("doit", CommandDoit , "doit")
return true
end
function CommandDoit(a_Split)
local area = cBlockArea()
area:Create(500, 100, 100)
for x = 0, 499 do
for y = 0, 99 do
for z = 0, 99 do
area:SetBlockType(x, y, z, 1)
end
end
end
collectgarbage()
print("finished")
return true
end
Could you try this?:
function CommandDoit(a_Split)
do
local area = cBlockArea()
area:Create(500, 100, 100)
for x = 0, 499 do
for y = 0, 99 do
for z = 0, 99 do
area:SetBlockType(x, y, z, 1)
end
end
end
end
collectgarbage()
print("finished")
return true
end
In your code, when calling the collectgarbage() function, the area variable is still in scope so it is not collected yet. Upon the next call, the cBlockArea from the previous call is collected and the current one is still kept, and so on.
(Yes, garbage collection is difficult
NiLSPACE's code fixes that by enclosing the inner code in yet another do .. end, which makes the area variable go out of scope before calling the collectgarbage() function, allowing it to be collected.
I see this in the travis builds from LuaThreadStress-testing. Is this a problem or can it be ignored?
Code:
Invalidate: Inconsistent callback at 0x2abac4000990, has a CS but an invalid Ref. This should not happen
That is indeed a problem, I'd need to look at that. But I can't seem to reproduce it on neither Win or Linux builds of mine.
Do we have a thread about metadata for items? I think this could be also used for items like: firework rocket, firework star, books and for a few more.