aboutsummaryrefslogtreecommitdiff
path: root/lstate.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Main thread is a regular field of global_StateRoberto Ierusalimschy2025-01-311-30/+9
| | | | | They were already allocated as a single block, so there is no need for the global_State to point to its main thread.
* New type 'TStatus' for thread status/error codesRoberto Ierusalimschy2025-01-301-3/+3
|
* 'objsize' returns 'l_mem'Roberto Ierusalimschy2024-11-151-2/+3
| | | | Sums of size_t may not fit in a size_t.
* Small bug in 'luaE_luaE_statesize'Roberto Ierusalimschy2024-10-211-2/+2
| | | | Plus, function was renamed to 'luaE_threadsize'.
* 'objsize' broke in smaller piecesRoberto Ierusalimschy2024-09-301-0/+8
|
* GC back to controling pace counting bytesRoberto Ierusalimschy2024-09-191-8/+6
| | | | Memory is the resource we want to save. Still to be reviewed again.
* Rename of fields in global state that control GCRoberto Ierusalimschy2024-09-061-8/+8
| | | | | All fields in the global state that control the pace of the garbage collector prefixed with 'GC'.
* Added gcc option '-Wconversion'Roberto Ierusalimschy2024-07-271-2/+3
| | | | | No warnings for standard numerical types. Still pending alternative numerical types.
* 'nresults' moved into 'callstatus'Roberto Ierusalimschy2024-07-211-1/+0
| | | | That gives us more free bits in 'callstatus', for future use.
* Cleaning of llimits.hRoberto Ierusalimschy2024-06-201-0/+21
| | | | | | Several definitions that don't need to be "global" (that is, that concerns only specific parts of the code) moved out of llimits.h, to more appropriate places.
* 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'...)
* Removed deprecated function 'setcstacklimit'Roberto Ierusalimschy2024-02-071-6/+0
|
* Clear interface between references and predefinesRoberto Ierusalimschy2024-01-151-0/+3
| | | | | 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-1/+1
| | | | 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/+6
| | | | | This encoding brings more precision and a larger range for these parameters.
* First criteria for shifts minor<->majorRoberto Ierusalimschy2023-12-071-1/+2
|
* Comments detailing the ages for generational GCRoberto Ierusalimschy2023-11-291-2/+3
| | | | Plus other comments and small details.
* Merge branch 'newarray' into nextversionRoberto Ierusalimschy2023-11-071-2/+5
|\
| * Merge branch 'master' into newarrayRoberto Ierusalimschy2023-11-031-3/+3
| |\
| * | Full abstraction for representation of array valuesRoberto Ierusalimschy2023-10-301-2/+5
| | |
* | | Merge branch 'master' into nextversionRoberto Ierusalimschy2023-08-231-1/+1
|\ \ \ | | |/ | |/|
| * | More disciplined use of 'getstr' and 'tsslen'Roberto Ierusalimschy2023-08-171-1/+1
| | | | | | | | | | | | | | | We may want to add other string variants in the future; this change documents better where the code may need to handle those variants.
* | | Merge branch 'master' into nextversionRoberto Ierusalimschy2023-06-221-3/+3
|\| |
| * | Several functions turned 'static'Roberto Ierusalimschy2023-05-221-2/+2
| |/ | | | | | | | | Several functions that were already being used only inside their own file have been declared as 'static'.
| * "Emergency" new version 5.4.6v5.4.6Roberto Ierusalimschy2023-05-021-1/+9
| | | | | | | | | | | | '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-33/+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.
* | Changed signal of GC debtRoberto Ierusalimschy2022-12-131-3/+3
| | | | | | | | Positive debts seems more natural then negative ones.
* | Revamp of GC parametersRoberto Ierusalimschy2022-12-131-4/+4
| | | | | | | | | | More uniformity when handling GC parameters + avoid divisions by 100 when applying them.
* | Simpler control for major collectionsRoberto Ierusalimschy2022-11-291-1/+0
| |
* | 'l_mem' renamed to 'l_obj' to count objectsRoberto Ierusalimschy2022-11-231-2/+2
| |
* | First version of GC counting objects for controlRoberto Ierusalimschy2022-11-231-7/+8
| | | | | | | | Still needs to review generational mode.
* | Added a counter of the total number of existing objectsRoberto Ierusalimschy2022-11-031-0/+2
|/ | | | It may simplify the control of the garbage collector.
* Threads are created like other objectsRoberto Ierusalimschy2022-11-011-8/+4
| | | | | Using a version of 'luaC_newobj' that allows offsets (extra space before the object itself).
* Stack indices changed to union'sRoberto Ierusalimschy2022-10-291-21/+21
| | | | | That will allow to change pointers to offsets while reallocating the stack.
* Bug: stack overflow with nesting of coroutine.closeRoberto Ierusalimschy2022-10-251-1/+2
|
* Bug: GC is not reentrantRoberto Ierusalimschy2021-12-131-2/+2
| | | | As the GC is not reentrant, finalizers should not be able to invoke it.
* Bug: Lua stack still active when closing a stateRoberto Ierusalimschy2021-12-101-0/+1
|
* Bug: Wrong status in coroutine during resetRoberto Ierusalimschy2021-11-081-2/+2
| | | | | | | | | When closing variables during 'coroutine.close' or 'lua_resetthread', the status of a coroutine must be set to LUA_OK; a coroutine should not run with any other status. (See assertion in 'lua_callk'.) After the reset, the status should be kept as normal, as any error was already reported.
* DetailsRoberto Ierusalimschy2021-03-291-1/+1
| | | | Comments and small improvements in the manual.
* New control for reentrancy of emergency collectionsRoberto Ierusalimschy2021-02-261-0/+1
| | | | | | Instead of assuming that shrinking a block may be an emergency collection, use an explicit field ('gcstopem') to stop emergency collections while GC is working.
* Broadening the use of branch hintsRoberto Ierusalimschy2021-02-241-1/+1
| | | | | | More uses of macros 'likely'/'unlikely' (renamed to 'l_likely'/'l_unlikely'), both in range (extended to the libraries) and in scope (extended to hooks, stack growth).
* New implementation for to-be-closed variablesRoberto Ierusalimschy2021-02-091-6/+9
| | | | | | | | 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 macro 'completestate'Roberto Ierusalimschy2021-02-051-4/+2
|
* Simpler handling of errors when creating tbc variablesRoberto Ierusalimschy2021-01-191-2/+2
| | | | | | New field 'lua_State.ptbc' keeps to-be-closed variable until its upvalue is created, so that it can be closed in case of a memory-allocation error.
* Allow yields inside '__close' metamethodsRoberto Ierusalimschy2021-01-131-1/+1
| | | | | | | Initial implementation to allow yields inside '__close' metamethods. This current version still does not allow a '__close' metamethod to yield when called due to an error. '__close' metamethods from C functions also are not allowed to yield.
* Reset thread before panickingRoberto Ierusalimschy2020-12-281-9/+13
| | | | | Before panicking, it is simpler to reset the thread instead of closing its variables and adjust the top manually.
* Cleaner handling of errors in '__close' metamethodsRoberto Ierusalimschy2020-12-281-5/+5
| | | | | Instead of protecting each individual metamethod call, protect the entire call to 'luaF_close'.
* 'coroutine.close'/'lua_resetthread' report original errorsRoberto Ierusalimschy2020-12-181-3/+5
| | | | | | Besides errors in closing methods, 'coroutine.close' and 'lua_resetthread' also consider the original error that stopped the thread, if any.
* Changed access to global table in the registryRoberto Ierusalimschy2020-11-261-6/+3
| | | | | The global table is always in the array part of the registry; we can use this fact to make its access slightly more efficient.