diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2023-03-20 16:13:17 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2023-03-20 16:13:17 -0300 |
commit | 5a04f1851e0d42b4bcbb0af103490bc964e985aa (patch) | |
tree | 227f98d4fff3f1bd1eea4d20ddd4aa0ec7562ddd /ltests.h | |
parent | 8c064fdc23bd745bbd3456a58cc9e2521f8e4263 (diff) | |
download | lua-5a04f1851e0d42b4bcbb0af103490bc964e985aa.tar.gz lua-5a04f1851e0d42b4bcbb0af103490bc964e985aa.tar.bz2 lua-5a04f1851e0d42b4bcbb0af103490bc964e985aa.zip |
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.
Diffstat (limited to 'ltests.h')
-rw-r--r-- | ltests.h | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -102,7 +102,8 @@ LUA_API void *debug_realloc (void *ud, void *block, | |||
102 | size_t osize, size_t nsize); | 102 | size_t osize, size_t nsize); |
103 | 103 | ||
104 | #if defined(lua_c) | 104 | #if defined(lua_c) |
105 | #define luaL_newstate() lua_newstate(debug_realloc, &l_memcontrol) | 105 | #define luaL_newstate() \ |
106 | lua_newstate(debug_realloc, &l_memcontrol, luaL_makeseed(NULL)) | ||
106 | #define luai_openlibs(L) \ | 107 | #define luai_openlibs(L) \ |
107 | { luaL_openlibs(L); \ | 108 | { luaL_openlibs(L); \ |
108 | luaL_requiref(L, "T", luaB_opentests, 1); \ | 109 | luaL_requiref(L, "T", luaB_opentests, 1); \ |