MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / luaS_newudata

Function luaS_newudata

extlibs/lua/src/lstring.c:270–284  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

268
269
270Udata *luaS_newudata (lua_State *L, size_t s, int nuvalue) {
271 Udata *u;
272 int i;
273 GCObject *o;
274 if (unlikely(s > MAX_SIZE - udatamemoffset(nuvalue)))
275 luaM_toobig(L);
276 o = luaC_newobj(L, LUA_VUSERDATA, sizeudata(nuvalue, s));
277 u = gco2u(o);
278 u->len = s;
279 u->nuvalue = nuvalue;
280 u->metatable = NULL;
281 for (i = 0; i < nuvalue; i++)
282 setnilvalue(&u->uv[i].uv);
283 return u;
284}
285

Callers 1

lua_newuserdatauvFunction · 0.85

Calls 2

luaM_toobigFunction · 0.85
luaC_newobjFunction · 0.85

Tested by

no test coverage detected