aboutsummaryrefslogtreecommitdiff
path: root/lstate.h (follow)
Commit message (Collapse)AuthorAgeFilesLines
* 'lua_State.nci' must be an integerRoberto Ierusalimschy2025-02-261-1/+1
| | | | | | Lua can easily overflow an unsigned short counting nested calls. (The limit to this value is the maximum stack size, LUAI_MAXSTACK, which is currently 1e6.)
* Main thread is a regular field of global_StateRoberto Ierusalimschy2025-01-311-34/+44
| | | | | 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-4/+4
|
* CallInfo bit CIST_CLSRET broken in twoRoberto Ierusalimschy2025-01-281-1/+3
| | | | | | | | | Since commit f407b3c4a, it was being used for two distinct (and incompatible) meanings: A: Function has TBC variables (now bit CIST_TBC) B: Interpreter is closing TBC variables (original bit CIST_CLSRET) B implies A, but A does not imply B.
* Improvements in the manualRoberto Ierusalimschy2025-01-101-1/+1
| | | | Plus details
* Counter for length of chains of __call metamethodsRoberto Ierusalimschy2024-11-161-11/+17
| | | | | This counter will allow (in a later commit) error messages to correct argument numbers in functions called through __call metamethods.
* More integration of 'nresults' into 'callstatus'Roberto Ierusalimschy2024-11-151-13/+20
|
* 'objsize' returns 'l_mem'Roberto Ierusalimschy2024-11-151-1/+1
| | | | Sums of size_t may not fit in a size_t.
* Small bug in 'luaE_luaE_statesize'Roberto Ierusalimschy2024-10-211-1/+1
| | | | Plus, function was renamed to 'luaE_threadsize'.
* 'objsize' broke in smaller piecesRoberto Ierusalimschy2024-09-301-0/+1
|
* GC back to controling pace counting bytesRoberto Ierusalimschy2024-09-191-8/+7
| | | | 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-4/+4
| | | | | All fields in the global state that control the pace of the garbage collector prefixed with 'GC'.
* Struct 'transferinfo' moved to "lua_State"Roberto Ierusalimschy2024-07-301-12/+8
| | | | | | That reduces the size of "CallInfo". Moreover, bit CIST_HOOKED from call status is not needed. When in a hook, 'transferinfo' is always valid, being zero when the hook is not call/return.
* Added gcc option '-Wconversion'Roberto Ierusalimschy2024-07-271-1/+1
| | | | | No warnings for standard numerical types. Still pending alternative numerical types.
* 'nresults' moved into 'callstatus'Roberto Ierusalimschy2024-07-211-19/+35
| | | | That gives us more free bits in 'callstatus', for future use.
* Maximum stack size may not fit in unsigned shortRoberto Ierusalimschy2024-07-161-2/+2
| | | | | | Therefore, fields ftransfer/ntransfer in lua_Debug must have type 'int'. (Maximum stack size must fit in an 'int'.) Also, this commit adds check that maximum stack size respects size_t for size in bytes.
* Cleaning of llimits.hRoberto Ierusalimschy2024-06-201-0/+11
| | | | | | 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.
* DetailsRoberto Ierusalimschy2024-05-081-1/+1
| | | | | Corrections in comments and manual. Added note in the manual about local variables in the REPL.
* New option "setparms" for 'collectgarbage'Roberto Ierusalimschy2023-12-221-6/+1
| | | | | | 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-4/+5
|
* 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.
* Merge branch 'master' into nextversionRoberto Ierusalimschy2023-08-231-1/+1
|\
| * Bug: Call hook may be called twice when count hook yieldsRoberto Ierusalimschy2023-07-251-1/+1
| | | | | | | | | | Took the opportunity and moved the code that controls call hooks in 'luaV_execute' into a function.
* | Merge branch 'master' into nextversionRoberto Ierusalimschy2023-06-221-1/+0
|\|
| * Several functions turned 'static'Roberto Ierusalimschy2023-05-221-1/+0
| | | | | | | | | | Several functions that were already being used only inside their own file have been declared as 'static'.
* | Merge branch 'master' into nextversionRoberto Ierusalimschy2022-12-141-3/+8
|\|
| * Details in some header filesRoberto Ierusalimschy2022-12-141-3/+8
| | | | | | | | | | Identifier LUA_NUMTAGS was deprecated (changed to LUA_NUMTYPES) + better handling of some inclusion loops.
* | Changed signal of GC debtRoberto Ierusalimschy2022-12-131-3/+3
| | | | | | | | Positive debts seems more natural then negative ones.
* | Simpler control for major collectionsRoberto Ierusalimschy2022-11-291-4/+4
| |
* | 'l_mem' renamed to 'l_obj' to count objectsRoberto Ierusalimschy2022-11-231-5/+5
| |
* | First version of GC counting objects for controlRoberto Ierusalimschy2022-11-231-4/+6
| | | | | | | | Still needs to review generational mode.
* | Added a counter of the total number of existing objectsRoberto Ierusalimschy2022-11-031-0/+1
|/ | | | It may simplify the control of the garbage collector.
* Stack indices changed to union'sRoberto Ierusalimschy2022-10-291-7/+7
| | | | | That will allow to change pointers to offsets while reallocating the stack.
* Fix debug information about finalizersRoberto Ierusalimschy2021-12-141-1/+1
| | | | | | The flag CIST_FIN does not mark a finalizer, but the function that was running when the finalizer was called. (So, the function did not call the finalizer, but it looks that way in the stack.)
* Bug: GC is not reentrantRoberto Ierusalimschy2021-12-131-1/+1
| | | | As the GC is not reentrant, finalizers should not be able to invoke it.
* Bug: yielding in '__close' mess up number of returnsRoberto Ierusalimschy2021-04-161-1/+1
| | | | | Yielding in a __close metamethod called when returning vararg results changes the top and so messes up the number of returned values.
* 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.
* '__close' methods can yield in the return of a C functionRoberto Ierusalimschy2021-02-121-4/+8
| | | | | | | When, inside a coroutine, a C function with to-be-closed slots return, the corresponding metamethods can yield. ('__close' metamethods called through 'lua_closeslot' still cannot yield, as there is no continuation to go when resuming.)
* New implementation for to-be-closed variablesRoberto Ierusalimschy2021-02-091-1/+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 macro 'completestate'Roberto Ierusalimschy2021-02-051-0/+6
|
* Janitorial workRoberto Ierusalimschy2021-01-251-0/+10
| | | | Comments, code details, identation.
* Simpler handling of errors when creating tbc variablesRoberto Ierusalimschy2021-01-191-0/+1
| | | | | | 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 in '__close' metamethods ater errorsRoberto Ierusalimschy2021-01-181-3/+19
| | | | | | Completes commit b07fc10e91a. '__close' metamethods can yield even when they are being called due to an error. '__close' metamethods from C functions are still not allowed to yield.
* Reset thread before panickingRoberto Ierusalimschy2020-12-281-0/+1
| | | | | Before panicking, it is simpler to reset the thread instead of closing its variables and adjust the top manually.
* No more field 'lua_State.stacksize'Roberto Ierusalimschy2020-10-121-3/+10
| | | | | | 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.
* Correct handling of 'luaV_execute' invocationsRoberto Ierusalimschy2020-10-121-7/+8
| | | | | | | | | The previous stackless implementations marked all 'luaV_execute' invocations as fresh. However, re-entering 'luaV_execute' when resuming a coroutine should not be a fresh invocation. (It works because 'unroll' called 'luaV_execute' for each call entry, but it was slower than letting 'luaV_execute' finish all non-fresh invocations.)
* Revision of stackless implementationRoberto Ierusalimschy2020-10-121-46/+10
| | | | | | - more organized handling of 'nCcalls' - comments - deprecation of 'setcstacklimit'
* Back to a stackless implementationRoberto Ierusalimschy2020-10-121-7/+0
| | | | | | | | | | | | | A "with stack" implementation gains too little in performance to be worth all the noise from C-stack overflows. This commit is almost a sketch, to test performance. There are several pending stuff: - review control of C-stack overflow and error messages; - what to do with setcstacklimit; - review comments; - review unroll of Lua calls.
* Details in comments and documentationRoberto Ierusalimschy2020-09-161-0/+11
|