Jump to content

  • Log In with Google      Sign In   
  • Create Account

Awesome job so far everyone! Please give us your feedback on how our article efforts are going. We still need more finished articles for our May contest theme: Remake the Classics

#Actualdmail

Posted 09 May 2012 - 05:56 AM

If you are determining that the stack is not empty via the return value of lua_gc then you are mistaken. The stack is not the only place when memory is used and a separate stack space is given to each C function which Lua calls, for instance there is _G the global table or _ENV the environment table in 5.2 (of which there can be many) and also the registry. Added to this a variable which is on the stack and also stored in another place will not be collected.

Rest assured your stack is empty and after such a time that there are no more references to the data, without you doing a gc (never mind 10), the memory will be released.

#2dmail

Posted 09 May 2012 - 05:55 AM

If you are determining that the stack is not empty via the return value of lua_gc then you are mistaken. The stack is not the only place when memory is used and a separate stack space is given to each C function which Lua calls, for instance there is _G the global table or _ENV the environment table in 5.2 (of which there can be many) and also the registry. Added to this a variable which is on the stack and also stored in another place will not be collected.

Rest assured your stack is empty and after such a time that there are no more reference to the data, without you doing a gc (never mind 10), the memory will be released.

#1dmail

Posted 09 May 2012 - 05:53 AM

If you are determining that the stack is not empty via the return value of lua_gc then you are mistaken. The stack is not the only place when memory is used and a separate stack space is given to each C function which Lua calls, for instance there is _G the global table or _ENV the environment table in 5.2 (of which there can be many) and also the registry. Added to this a variable which is on the stack and also stored in another place will not be collected.

Rest assured your stack is empty and in time without you doing a gc (never mind 10) the memory will be released.

PARTNERS