MCPcopy Create free account
hub / github.com/Tencent/xLua / xlua_newstruct

Function xlua_newstruct

WebGLPlugins/xlua.c:845–852  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

843}
844
845LUA_API void *xlua_newstruct(lua_State *L, int size, int meta_ref) {
846 CSharpStruct *css = (CSharpStruct *)lua_newuserdata(L, size + sizeof(int) + sizeof(unsigned int));
847 css->fake_id = -1;
848 css->len = size;
849 lua_rawgeti(L, LUA_REGISTRYINDEX, meta_ref);
850 lua_setmetatable(L, -2);
851 return css->data;
852}
853
854LUA_API void *xlua_tostruct(lua_State *L, int idx, int meta_ref) {
855 CSharpStruct *css = (CSharpStruct *)lua_touserdata(L, idx);

Callers

nothing calls this directly

Calls 3

lua_newuserdataFunction · 0.85
lua_rawgetiFunction · 0.85
lua_setmetatableFunction · 0.85

Tested by

no test coverage detected