Roberto Ierusalimschy
f7439112a5
Details (in test library)
...
- Added support for negative stack indices in the "C interpreter"
- Improved format when printing values
2025-01-29 14:47:06 -03:00
Roberto Ierusalimschy
c4e7cdb541
Renaming two new functions
...
'lua_numbertostrbuff' -> 'lua_numbertocstring'
'lua_pushextlstring' -> 'lua_pushexternalstring'
2025-01-27 16:09:55 -03:00
Roberto Ierusalimschy
7d7ae8781e
Parameters for 'lua_createtable' back to int
...
Tables don't accept sizes larger than int.
2025-01-21 13:33:59 -03:00
Roberto Ierusalimschy
664bda02ba
fixing 'lua_status' in panic.
...
'luaD_throw' may call 'luaE_resetthread', which returns an error code
but clears 'L->status'; so, 'luaD_throw' should set that status again.
2025-01-16 16:07:39 -03:00
Roberto Ierusalimschy
04e495403b
New function 'lua_printvalue' for internal debugging
2024-12-02 11:19:03 -03:00
Roberto Ierusalimschy
002beeebe7
New way to keep hints for table length
...
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.
2024-11-29 17:26:20 -03:00
Roberto Ierusalimschy
50c7c915ee
Debug information about extra arguments from __call
...
'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.
2024-11-19 14:09:18 -03:00
Roberto Ierusalimschy
2491b87c10
New rule for size of array part
...
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.
2024-11-13 13:37:24 -03:00
Roberto Ierusalimschy
25a2dac2bc
Always use unsigned int for indexing table-arrays
2024-10-24 15:33:25 -03:00
Roberto Ierusalimschy
258355734d
Better support in 'ltests' for tracing the GC
2024-10-21 15:18:20 -03:00
Roberto Ierusalimschy
ddfa1fbccf
GC back to controling pace counting bytes
...
Memory is the resource we want to save. Still to be reviewed again.
2024-09-19 19:02:14 -03:00
Roberto Ierusalimschy
f2206b2abe
'-Wconversion' extended to all options of Lua numbers
2024-07-27 15:13:21 -03:00
Roberto Ierusalimschy
0acd55898d
Added gcc option '-Wconversion'
...
No warnings for standard numerical types. Still pending alternative
numerical types.
2024-07-27 13:32:59 -03:00
Roberto Ierusalimschy
193bf7919e
'printstack' (from ltests.c) made public
...
That function is useful for debugging the API.
2024-07-05 14:57:11 -03:00
Roberto Ierusalimschy
c403e456b6
New instruction format for SETLIST/NEWTABLE
...
New instruction format 'ivABC' (a variant of iABC where parameter vC has
10 bits) allows constructors of up to 1024 elements to be coded without
EXTRAARG.
2024-06-28 11:18:14 -03:00
Roberto Ierusalimschy
9904c253da
Flexible limit for use of registers by constructors
...
Instead of a fixed limit of 50 registers (which, in a bad worst case,
can limit the nesting of constructors to 5 levels), the compiler
computes an individual limit for each constructor based on how many
registers are available when it runs. This limit then controls the
frequency of SETLIST instructions.
2024-06-27 11:24:27 -03:00
Roberto Ierusalimschy
b529aefc53
Bug: luaL_traceback may need more than 5 stack slots
2024-06-12 16:02:01 -03:00
Roberto Ierusalimschy
94b503d95e
Encoding of table indices (hres) must use C indices
...
As the encoding of array indices is (~index), 0 is encoded as -1 and
INT_MAX is encoded as INT_MIN.
2024-06-10 12:09:35 -03:00
Roberto Ierusalimschy
9fa63a6268
Some 'unsigned int' changed to 'unsigned'
...
'unsigned int' is too long sometimes. (We already write 'long' instead
of 'long int'...)
2024-03-22 14:06:11 -03:00
Roberto Ierusalimschy
0593256707
'luaH_get' functions return tag of the result
...
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.
2024-03-21 11:23:21 -03:00
Roberto Ierusalimschy
165389b27b
New interface to function 'luaL_openselectedlibs'
...
Instead of preloading all non-loaded libraries, there is another
mask to select which libraries to preload.
2024-02-15 11:17:39 -03:00
Roberto Ierusalimschy
108e0bdc84
Merge branch 'master' into nextversion
2024-01-25 13:52:52 -03:00
Roberto Ierusalimschy
17e0c29d9b
Clear interface between references and predefines
...
The reference system has a defined way to add initial values to the
table where it operates.
2024-01-15 11:31:49 -03:00
Roberto Ierusalimschy
8eb0abc9db
Removed uses of LUA_NUMTAGS
...
That constant was already deprecated (see commit 6aabf4b15e7).
2024-01-13 18:10:50 -03:00
Roberto Ierusalimschy
e2cc179454
New option "setparms" for 'collectgarbage'
...
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.
2023-12-22 14:48:07 -03:00
Roberto Ierusalimschy
ad0ea7813b
GC parameters encoded as floating-point bytes
...
This encoding brings more precision and a larger range for these
parameters.
2023-12-20 16:25:20 -03:00
Roberto Ierusalimschy
666e95a66d
Option 0 for step multiplier makes GC non-incremental
2023-12-20 11:06:27 -03:00
Roberto Ierusalimschy
789e7acdea
Major collections done incrementally
...
Major collections do not need to "stop the world". Still pending:
criteria for shifts minor-major, shifts generational-incremental.
2023-12-06 10:49:56 -03:00
Roberto Ierusalimschy
63d68bd657
Comments detailing the ages for generational GC
...
Plus other comments and small details.
2023-11-29 16:22:09 -03:00
Roberto Ierusalimschy
842a83f09c
Panic functions should not raise errors
...
The standard panic function was using 'lua_tostring', which may raise
a memory-allocation error if error value is a number.
2023-11-24 16:08:55 -03:00
Roberto Ierusalimschy
25cd3d377e
Buffer in 'luai_makeseed' measured in bytes
...
In the (rare) cases when sizeof(void*) or sizeof(time_t) are not
multiples of sizeof(int), we still can use all their bytes in the seed.
2023-11-15 10:28:32 -03:00
Roberto Ierusalimschy
024f9064f1
External strings
...
Strings can use external buffers to store their contents.
2023-11-09 17:05:42 -03:00
Roberto Ierusalimschy
37c215b43f
Merge branch 'newarray' into nextversion
2023-11-07 17:26:15 -03:00
Roberto Ierusalimschy
43c8e5bded
Full abstraction for representation of array values
2023-10-30 14:25:59 -03:00
Roberto Ierusalimschy
14e416355f
Added suport for Fixed Buffers
...
A fixed buffer keeps a binary chunk "forever", so that the program
does not need to copy some of its parts when loading it.
2023-09-05 15:30:45 -03:00
Roberto Ierusalimschy
ab6a949522
Merge branch 'master' into nextversion
2023-06-22 11:41:48 -03:00
Roberto Ierusalimschy
6443185167
"Emergency" new version 5.4.6
...
'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.
2023-05-02 16:41:43 -03:00
Roberto Ierusalimschy
5a04f1851e
New function 'luaL_makeseed'
...
This function unifies code from 'lua_newstate', 'math.randomseed',
and 'table.sort' that tries to create a value with a minimum level
of randomness.
2023-03-20 16:13:17 -03:00
Roberto Ierusalimschy
40565b4a08
Revamp of GC parameters
...
More uniformity when handling GC parameters + avoid divisions by 100
when applying them.
2022-12-13 11:55:14 -03:00
Roberto Ierusalimschy
d738c8d18b
New function 'luaL_openselectedlibs'
...
Makes it easier to start Lua with only some standard libraries.
2022-12-07 15:12:52 -03:00
Roberto Ierusalimschy
d324a0ccf9
Simpler control for major collections
2022-11-29 10:37:08 -03:00
Roberto Ierusalimschy
ec61be9a7e
'l_mem' renamed to 'l_obj' to count objects
2022-11-23 17:29:03 -03:00
Roberto Ierusalimschy
f356d5acdd
First version of GC counting objects for control
...
Still needs to review generational mode.
2022-11-23 17:17:20 -03:00
Roberto Ierusalimschy
8047b2d03e
Tables have a 'lastfree' information only when needed
...
Only tables with some minimum number of entries in their hash part
have a 'lastfree' field, kept in a header before the node vector.
2022-11-01 15:42:08 -03:00
Roberto Ierusalimschy
413a393e62
Stack indices changed to union's
...
That will allow to change pointers to offsets while reallocating
the stack.
2022-10-29 12:06:37 -03:00
Roberto Ierusalimschy
1e64c1391f
Bug: stack overflow with nesting of coroutine.close
2022-10-25 16:44:06 -03:00
Roberto Ierusalimschy
14d2803e55
Details
...
Some cast operations rewritten to use respective macros.
2022-10-19 16:29:54 -03:00
Roberto Ierusalimschy
439e45a2f6
Bug: luaL_tolstring may get confused with negative index
...
When object has a '__name' metafield, 'luaL_tolstring' used the
received index after pushing a string on the stack.
2021-07-22 13:48:43 -03:00
Roberto Ierusalimschy
9a2de786de
Stack check in warning function for tests
...
The warning function using for tests need to check the stack before
pushing anything. (Warning functions are not expected to access a
Lua state, therefore they have no preallocated stack space.)
2021-03-02 11:35:40 -03:00
Roberto Ierusalimschy
4e47f81188
New implementation for to-be-closed variables
...
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.
2021-02-09 14:00:05 -03:00