| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
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.)
|
|
|
|
|
| |
They were already allocated as a single block, so there is no need
for the global_State to point to its main thread.
|
| |
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
Plus details
|
|
|
|
|
| |
This counter will allow (in a later commit) error messages to correct
argument numbers in functions called through __call metamethods.
|
| |
|
|
|
|
| |
Sums of size_t may not fit in a size_t.
|
|
|
|
| |
Plus, function was renamed to 'luaE_threadsize'.
|
| |
|
|
|
|
| |
Memory is the resource we want to save. Still to be reviewed again.
|
|
|
|
|
| |
All fields in the global state that control the pace of the garbage
collector prefixed with 'GC'.
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
No warnings for standard numerical types. Still pending alternative
numerical types.
|
|
|
|
| |
That gives us more free bits in 'callstatus', for future use.
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
Corrections in comments and manual. Added note in the manual about
local variables in the REPL.
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
This encoding brings more precision and a larger range for these
parameters.
|
| |
|
|
|
|
|
| |
Major collections do not need to "stop the world". Still pending:
criteria for shifts minor-major, shifts generational-incremental.
|
|\ |
|
| |
| |
| |
| |
| | |
Took the opportunity and moved the code that controls call hooks
in 'luaV_execute' into a function.
|
|\| |
|
| |
| |
| |
| |
| | |
Several functions that were already being used only inside their
own file have been declared as 'static'.
|
|\| |
|
| |
| |
| |
| |
| | |
Identifier LUA_NUMTAGS was deprecated (changed to LUA_NUMTYPES) +
better handling of some inclusion loops.
|
| |
| |
| |
| | |
Positive debts seems more natural then negative ones.
|
| | |
|
| | |
|
| |
| |
| |
| | |
Still needs to review generational mode.
|
|/
|
|
| |
It may simplify the control of the garbage collector.
|
|
|
|
|
| |
That will allow to change pointers to offsets while reallocating
the stack.
|
|
|
|
|
|
| |
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.)
|
|
|
|
| |
As the GC is not reentrant, finalizers should not be able to invoke it.
|
|
|
|
|
| |
Yielding in a __close metamethod called when returning vararg results
changes the top and so messes up the number of returned values.
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
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.)
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
Comments, code details, identation.
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
Before panicking, it is simpler to reset the thread instead of closing
its variables and adjust the top manually.
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
| |
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.)
|
|
|
|
|
|
| |
- more organized handling of 'nCcalls'
- comments
- deprecation of 'setcstacklimit'
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|