From 5a04f1851e0d42b4bcbb0af103490bc964e985aa Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Mon, 20 Mar 2023 16:13:17 -0300 Subject: New function 'luaL_makeseed' This function unifies code from 'lua_newstate', 'math.randomseed', and 'table.sort' that tries to create a value with a minimum level of randomness. --- ltests.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'ltests.h') diff --git a/ltests.h b/ltests.h index 45d5beba..da773d6e 100644 --- a/ltests.h +++ b/ltests.h @@ -102,7 +102,8 @@ LUA_API void *debug_realloc (void *ud, void *block, size_t osize, size_t nsize); #if defined(lua_c) -#define luaL_newstate() lua_newstate(debug_realloc, &l_memcontrol) +#define luaL_newstate() \ + lua_newstate(debug_realloc, &l_memcontrol, luaL_makeseed(NULL)) #define luai_openlibs(L) \ { luaL_openlibs(L); \ luaL_requiref(L, "T", luaB_opentests, 1); \ -- cgit v1.2.3-55-g6feb