lua-users home
lua-l archive

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


I'm having some problems with the gc fallback. I want to take some
action when tables are collected (in particular, I want to explicitly
free a particular userdata member), but I seem to be unable to index a
table in a gc fallback function without causing unlimited recursion
and, eventually, a core dump. Here's a tiny program that shows this
behaviour:

	function gc(table)
		if table[nil] then end
	end
	setfallback("gc", gc)

	i = 1
	while i <= 1000 do
		table = {}
		i = i + 1
	end

I'd be very grateful for any advice anyone can offer.

Regards,

Alan Watson