So I understand that Lua uses reference counts for objects to determine when to truly garbage collect objects with no references but I have a quick question regarding local variables.
Suppose I have this code:
local function changeX(x)
local dx = math.random(0, 20)
x = x + dx
newX = changeX(5)
My question is, will I have a memory leak if I run this function say 1000 times without niling "dx"?
I don't mind niling these variables each time, but I'm worried that unnecessarily niling variables might cause slight performance drops for similar functions that I might be calling 100+ times a frame.