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

Function luai_makeseed

3rd/lua-5.4.3/src/lstate.c:71–80  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

69 memcpy(b + p, &t, sizeof(t)); p += sizeof(t); }
70
71static unsigned int luai_makeseed (lua_State *L) {
72 char buff[3 * sizeof(size_t)];
73 unsigned int h = cast_uint(time(NULL));
74 int p = 0;
75 addbuff(buff, p, L); /* heap variable */
76 addbuff(buff, p, &h); /* local variable */
77 addbuff(buff, p, &lua_newstate); /* public function */
78 lua_assert(p == sizeof(buff));
79 return luaS_hash(buff, p, h);
80}
81
82#endif
83

Callers 1

lua_newstateFunction · 0.85

Calls 1

luaS_hashFunction · 0.85

Tested by

no test coverage detected