| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
They were already allocated as a single block, so there is no need
for the global_State to point to its main thread.
|
| |
|
|
|
|
| |
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'.
|
|
|
|
|
| |
No warnings for standard numerical types. Still pending alternative
numerical types.
|
|
|
|
| |
That gives us more free bits in 'callstatus', for future use.
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
'unsigned int' is too long sometimes. (We already write 'long' instead
of 'long int'...)
|
| |
|
|
|
|
|
| |
The reference system has a defined way to add initial values to the
table where it operates.
|
|
|
|
| |
That constant was already deprecated (see commit 6aabf4b15e7).
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
Plus other comments and small details.
|
|\ |
|
| |\ |
|
| | | |
|
|\ \ \
| | |/
| |/| |
|
| | |
| | |
| | |
| | |
| | | |
We may want to add other string variants in the future; this change
documents better where the code may need to handle those variants.
|
|\| | |
|
| |/
| |
| |
| |
| | |
Several functions that were already being used only inside their
own file have been declared as 'static'.
|
| |
| |
| |
| |
| |
| | |
'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.
|
| |
| |
| |
| |
| |
| | |
This function unifies code from 'lua_newstate', 'math.randomseed',
and 'table.sort' that tries to create a value with a minimum level
of randomness.
|
| |
| |
| |
| | |
Positive debts seems more natural then negative ones.
|
| |
| |
| |
| |
| | |
More uniformity when handling GC parameters + avoid divisions by 100
when applying them.
|
| | |
|
| | |
|
| |
| |
| |
| | |
Still needs to review generational mode.
|
|/
|
|
| |
It may simplify the control of the garbage collector.
|
|
|
|
|
| |
Using a version of 'luaC_newobj' that allows offsets (extra space
before the object itself).
|
|
|
|
|
| |
That will allow to change pointers to offsets while reallocating
the stack.
|
| |
|
|
|
|
| |
As the GC is not reentrant, finalizers should not be able to invoke it.
|
| |
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
Comments and small improvements in the manual.
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
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).
|
|
|
|
|
|
|
|
| |
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 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.
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
Before panicking, it is simpler to reset the thread instead of closing
its variables and adjust the top manually.
|
|
|
|
|
| |
Instead of protecting each individual metamethod call, protect the
entire call to 'luaF_close'.
|
|
|
|
|
|
| |
Besides errors in closing methods, 'coroutine.close' and
'lua_resetthread' also consider the original error that stopped the
thread, if any.
|
|
|
|
|
| |
The global table is always in the array part of the registry; we can
use this fact to make its access slightly more efficient.
|