use new lua userdata api

This commit is contained in:
Cloud Wu
2020-10-10 19:19:33 +08:00
parent 623d8182eb
commit a87b039c6d
10 changed files with 26 additions and 26 deletions

View File

@@ -152,7 +152,7 @@ new_channel(lua_State *L, struct channel *c) {
luaL_error(L, "new channel failed");
// never go here
}
struct channel_box * cb = lua_newuserdata(L, sizeof(*cb));
struct channel_box * cb = lua_newuserdatauv(L, sizeof(*cb), 0);
cb->c = c;
if (luaL_newmetatable(L, METANAME)) {
luaL_Reg l[]={