Skip to content
On this page

Incompatibilities in the API

  • Full userdata now has an arbitrary number of associated user values. Therefore, the functions lua_newuserdata, lua_setuservalue, and lua_getuservalue were replaced by lua_newuserdatauv, lua_setiuservalue, and lua_getiuservalue, which have an extra argument.

    For compatibility, the old names still work as macros assuming one single user value. Note, however, that userdata with zero user values are more efficient memory-wise.

  • The function lua_resume has an extra parameter. This out parameter returns the number of values on the top of the stack that were yielded or returned by the coroutine. (In previous versions, those values were the entire stack.)

  • The function lua_version returns the version number, instead of an address of the version number. The Lua core should work correctly with libraries using their own static copies of the same core, so there is no need to check whether they are using the same address space.

  • The constant LUA_ERRGCMM was removed. Errors in finalizers are never propagated; instead, they generate a warning.

  • The options LUA_GCSETPAUSE and LUA_GCSETSTEPMUL of the function lua_gc are deprecated. You should use the new option LUA_GCINC to set them.