aboutsummaryrefslogtreecommitdiff
path: root/ltests.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Main thread is a regular field of global_StateRoberto Ierusalimschy2025-01-311-2/+2
| | | | | They were already allocated as a single block, so there is no need for the global_State to point to its main thread.
* Details (in test library)Roberto Ierusalimschy2025-01-291-5/+16
| | | | | - Added support for negative stack indices in the "C interpreter" - Improved format when printing values
* Renaming two new functionsRoberto Ierusalimschy2025-01-271-2/+2
| | | | | 'lua_numbertostrbuff' -> 'lua_numbertocstring' 'lua_pushextlstring' -> 'lua_pushexternalstring'
* Parameters for 'lua_createtable' back to intRoberto Ierusalimschy2025-01-211-3/+3
| | | | Tables don't accept sizes larger than int.
* fixing 'lua_status' in panic.Roberto Ierusalimschy2025-01-161-2/+8
| | | | | 'luaD_throw' may call 'luaE_resetthread', which returns an error code but clears 'L->status'; so, 'luaD_throw' should set that status again.
* New function 'lua_printvalue' for internal debuggingRoberto Ierusalimschy2024-12-021-4/+36
|
* New way to keep hints for table lengthRoberto Ierusalimschy2024-11-291-3/+3
| | | | | | | | | | Instead of using 'alimit' for keeping the size of the array and at the same time being a hint for '#t', a table now keeps these two values separate. The Table structure has a field 'asize' with the size of the array, while the length hint is kept in the array itself. That way, tables with no array part waste no space with that field. Moreover, the space for the hint may have zero cost for small arrays, if the array of tags plus the hint still fits in a single word.
* Debug information about extra arguments from __callRoberto Ierusalimschy2024-11-191-0/+4
| | | | | | 'debug.getinfo' can return number of extra arguments added to a call by a chain of __call metavalues. That information is being used to improve error messages about errors in these extra arguments.
* New rule for size of array partRoberto Ierusalimschy2024-11-131-4/+7
| | | | | | | | Array part needs 1/3 of its elements filled, instead of 1/2. Array entries use ~1/3 the memory of hash entries, so this new rule still ensures that array parts do not use more memory than keeping the values in the hash, while allowing more uses of the array part, which is more efficient than the hash.
* Always use unsigned int for indexing table-arraysRoberto Ierusalimschy2024-10-241-1/+1
|
* Better support in 'ltests' for tracing the GCRoberto Ierusalimschy2024-10-211-19/+49
|
* GC back to controling pace counting bytesRoberto Ierusalimschy2024-09-191-9/+9
| | | | Memory is the resource we want to save. Still to be reviewed again.
* '-Wconversion' extended to all options of Lua numbersRoberto Ierusalimschy2024-07-271-14/+14
|
* Added gcc option '-Wconversion'Roberto Ierusalimschy2024-07-271-31/+31
| | | | | No warnings for standard numerical types. Still pending alternative numerical types.
* 'printstack' (from ltests.c) made publicRoberto Ierusalimschy2024-07-051-2/+2
| | | | That function is useful for debugging the API.
* New instruction format for SETLIST/NEWTABLERoberto Ierusalimschy2024-06-281-0/+5
| | | | | | New instruction format 'ivABC' (a variant of iABC where parameter vC has 10 bits) allows constructors of up to 1024 elements to be coded without EXTRAARG.
* Flexible limit for use of registers by constructorsRoberto Ierusalimschy2024-06-271-1/+0
| | | | | | | | Instead of a fixed limit of 50 registers (which, in a bad worst case, can limit the nesting of constructors to 5 levels), the compiler computes an individual limit for each constructor based on how many registers are available when it runs. This limit then controls the frequency of SETLIST instructions.
* Bug: luaL_traceback may need more than 5 stack slotsRoberto Ierusalimschy2024-06-121-0/+5
|
* Encoding of table indices (hres) must use C indicesRoberto Ierusalimschy2024-06-101-2/+2
| | | | | As the encoding of array indices is (~index), 0 is encoded as -1 and INT_MAX is encoded as INT_MIN.
* Some 'unsigned int' changed to 'unsigned'Roberto Ierusalimschy2024-03-221-1/+1
| | | | | 'unsigned int' is too long sometimes. (We already write 'long' instead of 'long int'...)
* 'luaH_get' functions return tag of the resultRoberto Ierusalimschy2024-03-211-2/+4
| | | | | | | Undoing previous commit. Returning TValue increases code size without any visible gains. Returning the tag is a little simpler than returning a special code (HOK/HNOTFOUND) and the tag is useful by itself in some cases.
* 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.)