mirror of
https://github.com/luau-lang/luau.git
synced 2025-05-04 10:33:46 +01:00
Add lua_getuserdatadtor
This commit is contained in:
parent
42a2805f85
commit
6a30fe2fe4
2 changed files with 7 additions and 0 deletions
|
@ -314,6 +314,7 @@ LUA_API double lua_clock();
|
|||
|
||||
LUA_API void lua_setuserdatatag(lua_State* L, int idx, int tag);
|
||||
LUA_API void lua_setuserdatadtor(lua_State* L, int tag, void (*dtor)(lua_State*, void*));
|
||||
LUA_API void (*lua_getuserdatadtor(lua_State* L, int tag))(lua_State*, void*);
|
||||
|
||||
LUA_API void lua_clonefunction(lua_State* L, int idx);
|
||||
|
||||
|
|
|
@ -1384,6 +1384,12 @@ void lua_setuserdatadtor(lua_State* L, int tag, void (*dtor)(lua_State*, void*))
|
|||
L->global->udatagc[tag] = dtor;
|
||||
}
|
||||
|
||||
void (*lua_getuserdatadtor(lua_State* L, int tag))(lua_State*, void*)
|
||||
{
|
||||
api_check(L, unsigned(tag) < LUA_UTAG_LIMIT);
|
||||
return L->global->udatagc[tag];
|
||||
}
|
||||
|
||||
void lua_clonefunction(lua_State* L, int idx)
|
||||
{
|
||||
luaC_checkGC(L);
|
||||
|
|
Loading…
Add table
Reference in a new issue