MCPcopy Create free account
hub / github.com/CppCXY/EmmyLuaCodeStyle / lua_newuserdatauv

Function lua_newuserdatauv

3rd/lua-5.4.3/src/lapi.c:1335–1345  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1333
1334
1335LUA_API void *lua_newuserdatauv (lua_State *L, size_t size, int nuvalue) {
1336 Udata *u;
1337 lua_lock(L);
1338 api_check(L, 0 <= nuvalue && nuvalue < USHRT_MAX, "invalid value");
1339 u = luaS_newudata(L, size, nuvalue);
1340 setuvalue(L, s2v(L->top), u);
1341 api_incr_top(L);
1342 luaC_checkGC(L);
1343 lua_unlock(L);
1344 return getudatamem(u);
1345}
1346
1347
1348

Callers 4

setrandfuncFunction · 0.85
gmatchFunction · 0.85
newboxFunction · 0.85
newprefileFunction · 0.85

Calls 1

luaS_newudataFunction · 0.85

Tested by

no test coverage detected