MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / luaS_newudata

Function luaS_newudata

lib/lua/src/lstring.c:259–273  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

257
258
259Udata *luaS_newudata (lua_State *L, size_t s, int nuvalue) {
260 Udata *u;
261 int i;
262 GCObject *o;
263 if (l_unlikely(s > MAX_SIZE - udatamemoffset(nuvalue)))
264 luaM_toobig(L);
265 o = luaC_newobj(L, LUA_VUSERDATA, sizeudata(nuvalue, s));
266 u = gco2u(o);
267 u->len = s;
268 u->nuvalue = nuvalue;
269 u->metatable = NULL;
270 for (i = 0; i < nuvalue; i++)
271 setnilvalue(&u->uv[i].uv);
272 return u;
273}
274

Callers 1

lua_newuserdatauvFunction · 0.85

Calls 2

luaM_toobigFunction · 0.85
luaC_newobjFunction · 0.85

Tested by

no test coverage detected