Lua 5.5.0 Release (#2119)

* Lua 5.5 beta

* lua 5.5.0 release
This commit is contained in:
云风
2025-12-23 10:19:09 +08:00
committed by GitHub
parent 28e8087029
commit 406f3a7437
66 changed files with 6125 additions and 3857 deletions

View File

@@ -499,13 +499,27 @@ lalloc(void * ud, void *ptr, size_t osize, size_t nsize) {
return skynet_lalloc(ptr, osize, nsize);
}
static unsigned
global_seed() {
static ATOM_INT seed = 0;
unsigned ret = ATOM_LOAD(&seed);
while (ret == 0) {
unsigned t = luaL_makeseed(NULL);
if (t == 0)
t = 1;
ATOM_CAS(&seed, 0, t);
ret = ATOM_LOAD(&seed);
}
return ret;
}
struct snlua *
snlua_create(void) {
struct snlua * l = skynet_malloc(sizeof(*l));
memset(l,0,sizeof(*l));
l->mem_report = MEMORY_WARNING_REPORT;
l->mem_limit = 0;
l->L = lua_newstate(lalloc, l);
l->L = lua_newstate(lalloc, l, global_seed());
l->activeL = NULL;
ATOM_INIT(&l->trap , 0);
return l;