| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
Instead of receiving a parameter telling them where to put the result
of the query, these functions return the TValue directly. (That is,
they return a structure.)
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
| |
Avoid silent conversions from int to unsigned int when calling
'luaH_resize'; avoid silent conversions from lua_Integer to int in
'table.create'; MAXASIZE corrected for the new implementation of arrays;
'luaH_resize' checks explicitly whether new size respects MAXASIZE.
(Even constructors were bypassing that check.)
|
| | |
|
| | |
|
| |
|
|
|
|
| |
'lua_rawgeti' now uses "fast track"; 'lua_rawseti' still calls
'luaH_setint', but the latter was recoded to avoid extra overhead
when writing to the array part after 'alimit'.
|
| | |
|
| |
|
|
|
|
| |
- back with step size in collectgarbage("step")
- adjustments in defaults for some GC parameters
- adjustments in 'luaO_codeparam'
|
| |
|
|
|
|
| |
The meaning of different GC parameters changed, so there is point in
supporting old values for them. The new code simply ignores the
parameters when changing the GC mode, so the incompatibility is small.
|
| |
|
|
|
|
| |
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.
|
| |
|
|
|
| |
'lua_dump' signals to the writer function the end of a dump, so that
is has more freedom when using the stack.
|
| | |
|
| |
|
|
|
| |
Major collections do not need to "stop the world". Still pending:
criteria for shifts minor-major, shifts generational-incremental.
|
| |
|
|
| |
A call to 'collectgarbage("step")' always performs one GC basic step.
|
| |
|
|
| |
Options 'setpause' and 'setstepmul' were deprecated in Lua 5.4.
|
| |
|
|
| |
Strings can use external buffers to store their contents.
|
| |\ |
|
| | |\ |
|
| | | | |
|
| | | | |
|
| | | | |
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The array part of a table wastes too much space, due to padding.
To avoid that, we need to store values in the array as something
different from a TValue. Therefore, the API for table access
should not assume that any value in a table lives in a *TValue.
This commit is the first step to remove that assumption: functions
luaH_get*, instead of returning a *TValue where the value lives,
receive a *TValue where to put the value being accessed.
(We still have to change the luaH_set* functions.)
|
| |\ \ \
| | |/
| |/| |
|
| | |/
| |
| |
| |
| | |
We may want to add other string variants in the future; this change
documents better where the code may need to handle those variants.
|
| | |
| |
| |
| |
| | |
A repeated string in a dump is represented as an index to its first
occurence, instead of another copy of the string.
|
| | |
| |
| |
| | |
Positive debts seems more natural then negative ones.
|
| | |
| |
| |
| |
| | |
More uniformity when handling GC parameters + avoid divisions by 100
when applying them.
|
| | |
| |
| |
| |
| | |
Each incremental step has always the same size (stepsize), and the
debt for next step also is always the same.
|
| | | |
|
| | |
| |
| |
| |
| | |
Function calls do not create new objects. (It may use memory with
stack reallocation, but now that is irrelevant to the GC.)
|
| | | |
|
| |/
|
|
| |
Still needs to review generational mode.
|
| |
|
|
|
| |
That will allow to change pointers to offsets while reallocating
the stack.
|
| | |
|
| |
|
|
|
|
| |
'luaD_growstack' already checks that. This commit also fixes an
internal bug in 'luaD_growstack': a large 'n' could cause an arithmetic
overflow when computing 'needed'.
|
| |
|
|
| |
correction in macro for hard tests + type in comment
|
| |
|
|
| |
As the GC is not reentrant, finalizers should not be able to invoke it.
|
| |
|
|
|
| |
According to ISO C, "making a function an inline function suggests that
calls to the function be as fast as possible." (Not available in C89.)
|
| |
|
|
|
| |
'index2value' accepts pseudo-indices also when called from a Lua
function, through a hook.
|
| |
|
|
|
|
| |
The existence of 'lua_closeslot' is no reason for lua_pop not to close
to-be-closed variables too. It is too error-prone for lua_pop not to
close tbc variables being popped from the stack.
|
| |
|
|
|
|
|
|
| |
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.
|
| | |
|
| |
|
|
| |
Long time without using HARDSTACKTESTS...
|
| |
|
|
| |
Comments, code details, identation.
|
| |
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
Closing a to-be-closed variable with 'lua_settop' is too restrictive,
as it erases all slots above the variable. Moreover, it adds side
effects to 'lua_settop', which should be a fairly basic function.
|
| |
|
|
|
| |
Instead of protecting each individual metamethod call, protect the
entire call to 'luaF_close'.
|