| 843 | } |
| 844 | |
| 845 | LUA_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 | |
| 854 | LUA_API void *xlua_tostruct(lua_State *L, int idx, int meta_ref) { |
| 855 | CSharpStruct *css = (CSharpStruct *)lua_touserdata(L, idx); |
nothing calls this directly
no test coverage detected