lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Hello,

	Please someone could explain me how garbage collection work in lua.

	Is this code correct?

------------
function gc_fallback( o )
    print( "This is a garbage!" )
end

test = {}
tag = newtag()
settag( test, tag )
settagmethod( tag, "gc", gc_fallback() )
test.message = "Hello!!"
print( test.message )
test = nil
-----------

	I have had this output:
Hello!!

	but, I hoped this output message:
Hello!!
This is a garbage!



--- Marco Catunda
catunda@inf.puc-rio.br