aboutsummaryrefslogtreecommitdiff
path: root/ltests.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* New interface to function 'luaL_openselectedlibs'Roberto Ierusalimschy2024-02-151-2/+3
| | | | | Instead of preloading all non-loaded libraries, there is another mask to select which libraries to preload.
* Merge branch 'master' into nextversionRoberto Ierusalimschy2024-01-251-2/+3
|\
| * Panic functions should not raise errorsRoberto Ierusalimschy2023-11-241-2/+3
| | | | | | | | | | The standard panic function was using 'lua_tostring', which may raise a memory-allocation error if error value is a number.
* | Clear interface between references and predefinesRoberto Ierusalimschy2024-01-151-3/+25
| | | | | | | | | | The reference system has a defined way to add initial values to the table where it operates.
* | Removed uses of LUA_NUMTAGSRoberto Ierusalimschy2024-01-131-2/+2
| | | | | | | | That constant was already deprecated (see commit 6aabf4b15e7).
* | New option "setparms" for 'collectgarbage'Roberto Ierusalimschy2023-12-221-6/+6
| | | | | | | | | | | | The generational mode also uses the parameters for the incremental mode in its major collections, so it should be easy to change those parameters without having to change the GC mode.
* | GC parameters encoded as floating-point bytesRoberto Ierusalimschy2023-12-201-6/+27
| | | | | | | | | | This encoding brings more precision and a larger range for these parameters.
* | Option 0 for step multiplier makes GC non-incrementalRoberto Ierusalimschy2023-12-201-4/+4
| |
* | Major collections done incrementallyRoberto Ierusalimschy2023-12-061-3/+3
| | | | | | | | | | Major collections do not need to "stop the world". Still pending: criteria for shifts minor-major, shifts generational-incremental.
* | Comments detailing the ages for generational GCRoberto Ierusalimschy2023-11-291-4/+6
| | | | | | | | Plus other comments and small details.
* | Buffer in 'luai_makeseed' measured in bytesRoberto Ierusalimschy2023-11-151-0/+7
| | | | | | | | | | In the (rare) cases when sizeof(void*) or sizeof(time_t) are not multiples of sizeof(int), we still can use all their bytes in the seed.
* | External stringsRoberto Ierusalimschy2023-11-091-0/+33
| | | | | | | | Strings can use external buffers to store their contents.
* | Merge branch 'newarray' into nextversionRoberto Ierusalimschy2023-11-071-3/+7
|\ \
| * | Full abstraction for representation of array valuesRoberto Ierusalimschy2023-10-301-3/+7
| |/
* | Added suport for Fixed BuffersRoberto Ierusalimschy2023-09-051-2/+5
| | | | | | | | | | A fixed buffer keeps a binary chunk "forever", so that the program does not need to copy some of its parts when loading it.
* | Merge branch 'master' into nextversionRoberto Ierusalimschy2023-06-221-1/+1
|\|
| * "Emergency" new version 5.4.6v5.4.6Roberto Ierusalimschy2023-05-021-1/+1
| | | | | | | | | | | | 'lua_resetthread' is back to its original signature, to avoid incompatibilities in the ABI between releases of the same version. New function 'lua_closethread' added with the "correct" signature.
* | New function 'luaL_makeseed'Roberto Ierusalimschy2023-03-201-2/+2
| | | | | | | | | | | | This function unifies code from 'lua_newstate', 'math.randomseed', and 'table.sort' that tries to create a value with a minimum level of randomness.
* | Revamp of GC parametersRoberto Ierusalimschy2022-12-131-2/+2
| | | | | | | | | | More uniformity when handling GC parameters + avoid divisions by 100 when applying them.
* | New function 'luaL_openselectedlibs'Roberto Ierusalimschy2022-12-071-20/+4
| | | | | | | | Makes it easier to start Lua with only some standard libraries.
* | Simpler control for major collectionsRoberto Ierusalimschy2022-11-291-1/+1
| |
* | 'l_mem' renamed to 'l_obj' to count objectsRoberto Ierusalimschy2022-11-231-8/+8
| |
* | First version of GC counting objects for controlRoberto Ierusalimschy2022-11-231-0/+11
| | | | | | | | Still needs to review generational mode.
* | Tables have a 'lastfree' information only when neededRoberto Ierusalimschy2022-11-011-2/+1
|/ | | | | Only tables with some minimum number of entries in their hash part have a 'lastfree' field, kept in a header before the node vector.
* Stack indices changed to union'sRoberto Ierusalimschy2022-10-291-12/+12
| | | | | That will allow to change pointers to offsets while reallocating the stack.
* Bug: stack overflow with nesting of coroutine.closeRoberto Ierusalimschy2022-10-251-1/+1
|
* DetailsRoberto Ierusalimschy2022-10-191-5/+5
| | | | Some cast operations rewritten to use respective macros.
* Bug: luaL_tolstring may get confused with negative indexRoberto Ierusalimschy2021-07-221-0/+3
| | | | | When object has a '__name' metafield, 'luaL_tolstring' used the received index after pushing a string on the stack.
* Stack check in warning function for testsRoberto Ierusalimschy2021-03-021-0/+2
| | | | | | The warning function using for tests need to check the stack before pushing anything. (Warning functions are not expected to access a Lua state, therefore they have no preallocated stack space.)
* New implementation for to-be-closed variablesRoberto Ierusalimschy2021-02-091-0/+1
| | | | | | | | To-be-closed variables are linked in their own list, embedded into the stack elements. (Due to alignment, this information does not change the size of the stack elements in most architectures.) This new list does not produce garbage and avoids memory errors when creating tbc variables.
* New API function 'lua_closeslot'Roberto Ierusalimschy2021-01-111-0/+3
| | | | | | Closing a to-be-closed variable with 'lua_settop' is too restrictive, as it erases all slots above the variable. Moreover, it adds side effects to 'lua_settop', which should be a fairly basic function.
* Review of asserts in 'ltests.c'Roberto Ierusalimschy2020-12-081-56/+70
| | | | The module 'ltests.c' must work correctly with asserts off, too.
* 'luaL_newstate' should not allocate extra memoryRoberto Ierusalimschy2020-11-031-1/+1
| | | | | | | | The allocation of a userdata for the state of the warn system can cause a panic if it fails; 'luaL_ref' also can fail. This commit re-implements the warn system so that it does not need an explicit state. Instead, the system uses different functions to represent the different states.
* Hash always use all characters in a long stringRoberto Ierusalimschy2020-10-121-1/+0
| | | | | | | Hashes for long strings are computed only when they are used as keys in a table, not a too common case. And, in that case, it is to easy to force collisions changing only the characters which are not part of the hash.
* No more field 'lua_State.stacksize'Roberto Ierusalimschy2020-10-121-4/+4
| | | | | | The stack size is derived from 'stack_last', when needed. Moreover, the handling of stack sizes is more consistent, always excluding the extra space except when allocating/deallocating the array.
* Better tests for gray listsRoberto Ierusalimschy2020-08-071-9/+31
| | | | | Test uses an extra bit in 'marked' to mark all elements in gray lists and then check against elements colored gray.
* Clearer handling of gray lists when entering generational modeRoberto Ierusalimschy2020-08-031-12/+48
| | | | | | | | When entering generational mode, all objects are old. So, the only objects that need to be in a gray list are threads, which can be assigned without barriers. Changes in anything else (e.g., weak tables) will trigger barriers that, if needed, will add the object to a gray list.
* DetailsRoberto Ierusalimschy2020-07-291-2/+2
| | | | | The fields 'old' and 'finobjold' were renamed 'old1' and 'finobjold1', respectively, to make clearer the main ages of their elements.
* Function 'printobj' in 'ltests.c' made publicRoberto Ierusalimschy2020-07-271-0/+4
| | | | It helps to have this function available for debugging.
* Make sure that main thread is non yieldableRoberto Ierusalimschy2020-07-061-2/+5
| | | | | Main thread must be non yieldable even at "level 0" (bare API), outside the 'pcall' from 'lua.c'.
* Avoid memory allocation in some functions from 'ltests.c'Roberto Ierusalimschy2020-07-041-7/+20
| | | | | | | To allow their use in memory tests, some functions in 'ltests.c' should never allocate memory. To avoid this allocation, the library registers the strings used for status codes, and keeps the variable '_WARN' always defined (with false instead of nil).
* In 'lua_checkmemory', userdata can be gray, tooRoberto Ierusalimschy2020-06-151-0/+4
| | | | | Since commit ca6fe7449a74, userdata with uservalues can be gray and can belong to gray lists ('gclist').
* Avoid calling 'fprintf' with NULLRoberto Ierusalimschy2020-06-091-1/+3
| | | | | | Avoid undefined behavior in calls like «fprintf("%s", NULL)». ('lua_writestringerror' is implemented as 'fprintf', and 'lua_tostring' can return NULL if object is not a string.)
* Fixed bug in 'string.format("%p")'Roberto Ierusalimschy2020-03-161-2/+1
| | | | | The string "(null)" used for non-collectable values must be printed as a string, not as a pointer. (Bug introduced in commit e0cbaa50fa7).
* DetailsRoberto Ierusalimschy2020-02-271-5/+7
| | | | | Several details in code (e.g., moving a variable to the most inner scope that encloses its uses), comments, parameter names, extra tests.
* Clearer distinction between types and tagsRoberto Ierusalimschy2020-01-311-19/+19
| | | | | LUA_T* represents only types; tags (types + Variants) are represented by LUA_V* constants.
* Comments (mosty typos)Roberto Ierusalimschy2019-12-301-2/+2
|
* Details (mostly comments)Roberto Ierusalimschy2019-10-221-1/+1
|
* Default for warnings changed to "off"Roberto Ierusalimschy2019-08-201-1/+1
| | | | | Warnings are mostly a tool to help developers (e.g., by showing hidden error messages); regular users usually don't need to see them.
* Improvement in warn-mode '@store' (for testing)Roberto Ierusalimschy2019-08-181-8/+20
| | | | | | When using warn-mode '@store', from the test library, the tests ensure not only that the expected warnings were issued, but also that there was no extra warnings.