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

Function luaS_newudata

depends/lua/src/lstring.c:236–247  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

234
235
236Udata *luaS_newudata (lua_State *L, size_t s) {
237 Udata *u;
238 GCObject *o;
239 if (s > MAX_SIZE - sizeof(Udata))
240 luaM_toobig(L);
241 o = luaC_newobj(L, LUA_TUSERDATA, sizeludata(s));
242 u = gco2u(o);
243 u->len = s;
244 u->metatable = NULL;
245 setuservalue(L, u, luaO_nilobject);
246 return u;
247}
248

Callers 1

lua_newuserdataFunction · 0.85

Calls 2

luaM_toobigFunction · 0.85
luaC_newobjFunction · 0.85

Tested by

no test coverage detected