MCPcopy Create free account
hub / github.com/DFHack/dfhack / make_lua_userdata

Function make_lua_userdata

library/include/LuaTools.h:71–76  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

69 template <typename T, typename... Args>
70 requires (std::is_trivially_destructible_v<T>)
71 T* make_lua_userdata(lua_State* L, Args&&... args)
72 {
73 void* stg = lua_newuserdata(L, sizeof(T));
74 T * obj = ::new (stg) T(std::forward<Args>(args)...);
75 return obj;
76 }
77
78 DFHACK_EXPORT void PushDFHack(lua_State *state);
79 DFHACK_EXPORT void PushBaseGlobals(lua_State *state);

Callers

nothing calls this directly

Calls 1

lua_newuserdataFunction · 0.85

Tested by

no test coverage detected