lua-users home
lua-l archive

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


On Mon, Apr 12, 2010 at 7:00 PM, Aurora <bravefly@gmail.com> wrote:
> Dear Sam,
>
> "Possibly, it's because the last file created global vars, and the gc
> doesn't know that they will never be used again.  "
>
> That's it.   You are so bright.
> The method you give is  ok. But I need to do it in the C source code of lua, not in lua.

If you can do it in lua, you  can do it with lua's C interface, with a
bit more trouble:

  local g = {} -> lua_newtable()
  setfenv() -> lua_setfenv()
  setmetatable() -> lua_setmetatable()
  etc....

Sam