|
@ -1,5 +1,5 @@ |
|
|
/*
|
|
|
/*
|
|
|
** $Id: lstate.c,v 2.151 2018/02/05 17:11:37 roberto Exp roberto $ |
|
|
** $Id: lstate.c,v 2.152 2018/05/29 18:02:51 roberto Exp roberto $ |
|
|
** Global State |
|
|
** Global State |
|
|
** See Copyright Notice in lua.h |
|
|
** See Copyright Notice in lua.h |
|
|
*/ |
|
|
*/ |
|
@ -69,12 +69,11 @@ typedef struct LG { |
|
|
memcpy(b + p, &t, sizeof(t)); p += sizeof(t); } |
|
|
memcpy(b + p, &t, sizeof(t)); p += sizeof(t); } |
|
|
|
|
|
|
|
|
static unsigned int luai_makeseed (lua_State *L) { |
|
|
static unsigned int luai_makeseed (lua_State *L) { |
|
|
char buff[4 * sizeof(size_t)]; |
|
|
char buff[3 * sizeof(size_t)]; |
|
|
unsigned int h = cast_uint(time(NULL)); |
|
|
unsigned int h = cast_uint(time(NULL)); |
|
|
int p = 0; |
|
|
int p = 0; |
|
|
addbuff(buff, p, L); /* heap variable */ |
|
|
addbuff(buff, p, L); /* heap variable */ |
|
|
addbuff(buff, p, &h); /* local variable */ |
|
|
addbuff(buff, p, &h); /* local variable */ |
|
|
addbuff(buff, p, luaO_nilobject); /* global variable */ |
|
|
|
|
|
addbuff(buff, p, &lua_newstate); /* public function */ |
|
|
addbuff(buff, p, &lua_newstate); /* public function */ |
|
|
lua_assert(p == sizeof(buff)); |
|
|
lua_assert(p == sizeof(buff)); |
|
|
return luaS_hash(buff, p, h); |
|
|
return luaS_hash(buff, p, h); |
|
|