| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
Function broke in two and some checks moved to the caller. (We may
want to call it without the checks.)
|
|
|
|
|
|
|
| |
The array at the end of a Lua closure has pointers to upvalues, not
to tagged values. This bug cannot cause any issue: The ISO C standard
requires that all pointers to structures have the same representation,
so sizeof(TValue*) must be equal to sizeof(UpVal*).
|
| |
|
|
|
|
| |
Added two warnings to the makefile.
|
|
|
|
|
|
|
|
|
|
| |
Instead of using 'alimit' for keeping the size of the array and at
the same time being a hint for '#t', a table now keeps these two
values separate. The Table structure has a field 'asize' with the
size of the array, while the length hint is kept in the array itself.
That way, tables with no array part waste no space with that field.
Moreover, the space for the hint may have zero cost for small arrays,
if the array of tags plus the hint still fits in a single word.
|
| |
|
|
|
|
| |
The call to 'f' is done by the macro, to give it more flexibility.
|
|
|
|
|
|
| |
'debug.getinfo' can return number of extra arguments added to a call by
a chain of __call metavalues. That information is being used to improve
error messages about errors in these extra arguments.
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
It allows code that is only used by assertions but that are not
assertions (e.g., declaration of a variable used in a later assertion).
|
| |
|
|
|
|
|
| |
That allows 'getfreepos' to treat it like a regular hash part that has
a deleted entry.
|
|
|
|
|
|
|
|
| |
Without this extra space, sequences of insertions/deletions (and
some other uses) can have unpexpected low performances. See the
added tests for an example, and *Mathematical Models to Analyze Lua
Hybrid Tables and Why They Need a Fix* (MartÃnez, Nicaud, Rotondo;
arXiv:2208.13602v2) for detais.
|
|
|
|
|
|
|
|
| |
Array part needs 1/3 of its elements filled, instead of 1/2.
Array entries use ~1/3 the memory of hash entries, so this new rule
still ensures that array parts do not use more memory than keeping
the values in the hash, while allowing more uses of the array part,
which is more efficient than the hash.
|
| |
|
|
|
|
|
|
|
| |
If there are no integer keys outside the array part, there is no
reason to resize it, saving the time to count its elements. Moreover,
assignments to non-integer keys will not collapse a table created with
'table.create'.
|
| |
|
|
|
|
|
| |
It converts a Lua number to a string in a buffer, without creating
a new Lua string.
|
| |
|
|
|
|
| |
Plus, function was renamed to 'luaE_threadsize'.
|
| |
|
|
|
|
| |
Plus extra comments and other details.
|
| |
|
| |
|
|
|
|
|
|
| |
Any call to 'va_start' must have a corresponding call to 'va_end';
so, functions called between them (luaO_pushvfstring in particular)
cannot raise errors.
|
|
|
|
|
|
| |
Any call to 'va_start' must have a corresponding call to 'va_end';
so, functions called between them (luaO_pushvfstring in particular)
cannot raise errors.
|
| |
|
| |
|
|
|
|
|
| |
> warning C4334: '<<': result of 32-bit shift implicitly converted to
> 64 bits (was 64-bit shift intended?)
|
|
|
|
| |
USHRT_MAX does not fit in an 'int' in 16-bit systems.
|
|
|
|
| |
Memory is the resource we want to save. Still to be reviewed again.
|
|
|
|
| |
Fixed comments in sort partition.
|
|
|
|
|
| |
'size_t' is the common type for measuring memory. 'int' can be too
small for steps.
|
|
|
|
|
| |
All fields in the global state that control the pace of the garbage
collector prefixed with 'GC'.
|
|
|
|
| |
Identation + comments
|
|
|
|
|
|
|
|
|
|
| |
The use of a pointer (not access, only for computations) after its
deallocation is forbiden in ISO C, but seems to work fine in all
platforms we are aware of. So, using that to correct stack pointers
after a stack reallocation seems safe and is much simpler than the
current implementation (first change all pointers to offsets and
then changing the offsets back to pointers). Anyway, for now that
option is disabled.
|
| |
|
| |
|
|
|
|
|
|
|
| |
In function 'luaK_exp2val', used to generate code for indices: Macro
'hasjumps' does not consider the case when the whole expression is a
"jump" (a test). In all other of its uses, the surrounding code ensures
that the expression cannot be VJMP.
|
|
|
|
|
|
| |
Conversion float->string ensures that, for any float f,
tonumber(tostring(f)) == f, but still avoiding noise like 1.1
converting to "1.1000000000000001".
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
The callstatus flag CIST_CLSRET is used in all tests for the
presence of variables to be closed in C functions.
|
|
|
|
|
|
| |
The parameter 'nresults' in 'lua_call' and similar functions has a
limit of 250. It already had an undocumented (and unchecked) limit of
SHRT_MAX, but it is seldom larger than 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.
|
| |
|