MCPcopy Create free account
hub / github.com/EmmyLua/EmmyLuaDebugger / luaS_newudata

Function luaS_newudata

third-party/lua-5.5.0/src/lstring.c:286–300  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

284
285
286Udata *luaS_newudata (lua_State *L, size_t s, unsigned short nuvalue) {
287 Udata *u;
288 int i;
289 GCObject *o;
290 if (l_unlikely(s > MAX_SIZE - udatamemoffset(nuvalue)))
291 luaM_toobig(L);
292 o = luaC_newobj(L, LUA_VUSERDATA, sizeudata(nuvalue, s));
293 u = gco2u(o);
294 u->len = s;
295 u->nuvalue = nuvalue;
296 u->metatable = NULL;
297 for (i = 0; i < nuvalue; i++)
298 setnilvalue(&u->uv[i].uv);
299 return u;
300}
301
302
303struct NewExt {

Callers 1

lua_newuserdatauvFunction · 0.70

Calls 2

luaM_toobigFunction · 0.70
luaC_newobjFunction · 0.70

Tested by

no test coverage detected