lua-users home
lua-l archive

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



Are you sure you do not need to detect large upvalues as well?

Simplest example:

do
  local upvalue = { --[[ something large ]] }

  function my_function() -- global function
    print(tostring(upvalue))
  end
end

Upvalue would not be collected until my_function is collected.

HTH,
Alexander.
You are right!  I missed that, because I moved most to locals.

Can I force GC to collect this (from lua)?
Do I need to do something like "upvalue=nil" at the end of the routine in your above example?

TIA
Mike