lua-users home
lua-l archive

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


> And using lua_newuserdata for the whole structure is preferable
> because the GC will know the real size of the Lua heap, which is
> impossible if an indirection will be used.

Sure, but it all depends on the library you're binding to Lua.
If it is an external library you may not have a choice. For instance,
the stdio C library does the allocation for your and expects you to
tell it when to free data, hence the gc method (and the explicit close
method) in the io library.