Roberto Ierusalimschy
f407b3c4a1
Using CIST_CLSRET instead of trick with 'nresults'
The callstatus flag CIST_CLSRET is used in all tests for the
presence of variables to be closed in C functions.
4 months ago
Roberto Ierusalimschy
6b45ccf4ed
Removed compatibility with "= exp" in the REPL
4 months ago
Roberto Ierusalimschy
93fd6892f8
Fixed bug in 'multiline'
'incomplete' was popping error message that should be used in case
there is no more lines to complete the input, that is, 'pushline'
returns NULL, due to end of file.
4 months ago
Roberto Ierusalimschy
366c855648
lua.c loads 'readline' dynamically
(See comments in luaconf.h.) This change allows easier compilation,
as Lua compiles and works even if the package 'readline' is absent
from the system. Moreover, non-interactive uses don't load the library,
making the stand-alone slightly faster for small loads.
4 months ago
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.
4 months ago
Roberto Ierusalimschy
fb7e5b76c9
Clearer code for controlling maximum registers
Plus, added a test to check that limit.
4 months ago
Roberto Ierusalimschy
ef28e5f789
Removed 'int' size limit for string.rep
5 months ago
Roberto Ierusalimschy
ec65ab878e
Removed 'int' size limit for pack/unpack
5 months ago
Roberto Ierusalimschy
97ef8e7bd4
GC test was not restarting collector after pause
5 months ago
Roberto Ierusalimschy
b529aefc53
Bug: luaL_traceback may need more than 5 stack slots
5 months ago
Roberto Ierusalimschy
bdc85357aa
Bug: Active-lines for stripped vararg functions
Lua seg. faults when asked to create the 'activelines' table for a
vararg function with no debug information.
5 months ago
Roberto Ierusalimschy
814213b65f
utf8.offset returns also final position of character
'utf8.offset' returns two values: the initial and the final position
of the given character.
5 months ago
Roberto Ierusalimschy
262dc5729a
Details
Corrections in comments and manual. Added note in the manual about
local variables in the REPL.
6 months ago
Roberto Ierusalimschy
88a50ffa71
Fixed dangling 'StkId' in 'luaV_finishget'
Bug introduced in 05932567
.
7 months ago
Roberto Ierusalimschy
52aa2b5d24
Details
- 'unsigned int' -> 'unsigned'
- Some explicit casts to avoid warnings
- Test avoids printing the value of 'fail' (which may not be nil)
8 months ago
Roberto Ierusalimschy
65b07dd53d
API asserts for illegal pops of to-be-closed variables
8 months ago
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.
9 months ago
Roberto Ierusalimschy
0c9bec0d38
Better handling of size limit when resizing a table
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.)
9 months ago
Roberto Ierusalimschy
c31d6774ac
Details
9 months ago
Roberto Ierusalimschy
3e9dbe143d
New function 'table.create'
Creates a table preallocating memory. (It just exports to Lua the API
function 'lua_createtable'.)
10 months ago
Roberto Ierusalimschy
4a8e480864
New mechanism to query GC parameters
10 months ago
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.
10 months ago
Roberto Ierusalimschy
e288c5a918
Bug: Yielding in a hook stops in the wrong instruction
Yielding in a hook must decrease the program counter, because it already
counted an instruction that, in the end, was not executed. However,
that decrement should be done only when about to restart the thread.
Otherwise, inspecting the thread with the debug library shows it one
instruction behind of where it really is.
10 months ago
Roberto Ierusalimschy
e7af9cdf0b
Fixed buffers reuse absolute line information
11 months ago
Roberto Ierusalimschy
12b6f610b0
Several tweaks in the garbage collector
- back with step size in collectgarbage("step")
- adjustments in defaults for some GC parameters
- adjustments in 'luaO_codeparam'
11 months ago
Roberto Ierusalimschy
e81f586001
Removed compatibility option LUA_COMPAT_GCPARAMS
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.
11 months ago
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.
11 months ago
Roberto Ierusalimschy
666e95a66d
Option 0 for step multiplier makes GC non-incremental
11 months ago
Roberto Ierusalimschy
b719ff9399
Removed parameter in 'collectgarbage("step")'
A call to 'collectgarbage("step")' always performs one GC basic step.
11 months ago
Roberto Ierusalimschy
35a2fed2d1
Removed deprecated options in 'lua_gc'
Options 'setpause' and 'setstepmul' were deprecated in Lua 5.4.
11 months ago
Roberto Ierusalimschy
6d042a178f
Auxiliary buffer uses external strings
The buffer system from the auxiliary library reuses its buffer
as external memory when closing long strings.
12 months ago
Roberto Ierusalimschy
3b57e37e48
Fixed buffers save long strings as external.
1 year ago
Roberto Ierusalimschy
024f9064f1
External strings
Strings can use external buffers to store their contents.
1 year ago
Roberto Ierusalimschy
7923dbbf72
Bug: Recursion in 'getobjname' can stack overflow
'getobjname' now broken in two, a basic version that handles locals,
upvalues, and constants, and a full version, which uses the basic
version to handle table accesses (globals and fields).
1 year ago
Roberto Ierusalimschy
6baee9ef9d
Removed test for "corrupted binary dump"
Test is too non portable. (For instance, it does not work for
different number types.)
1 year ago
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.
1 year ago
Roberto Ierusalimschy
5ab6a5756b
Bug: Wrong line number for function calls
1 year ago
Roberto Ierusalimschy
f4211a5ea4
More control over encoding of test files
The few UTF-8 test files are commented as such, and there is only one
non UTF-8 test file (to test non UTF-8 sources).
1 year ago
Roberto Ierusalimschy
cbae016202
Details
1 year ago
Roberto Ierusalimschy
09f3c2372f
Option '-l' discards version sufix from file name
Like 'require', the command-line option '-l' discards an optional
version suffix (everything after an hyphen) from a file name when
creating the module name.
2 years ago
Roberto Ierusalimschy
c197885cb0
Small improvements in tests
2 years ago
Roberto Ierusalimschy
ab859fe59b
Bug: Loading a corrupted binary file can segfault
The size of the list of upvalue names are stored separated from the
size of the list of upvalues, but they share the same array.
2 years ago
Roberto Ierusalimschy
02bab9fc25
Bug: Wrong line in error message for arith. errors
It also causes 'L->top' to be wrong when the error happens,
triggering an 'assert'.
2 years ago
Roberto Ierusalimschy
314745ed84
Avoid excessive name pollution in test files
Test files are more polite regarding the use of globals when locals
would do, and when globals are necessary deleting them after use.
2 years ago
Roberto Ierusalimschy
0825cf237d
Detail in make file for testes/libs
Everything depends on the Lua version (as given by 'lua.h')
2 years ago
Roberto Ierusalimschy
7d4c7ae2af
Changes in opcodes for generic 'for'
Again, as the control variable is read only, the code doesn't need
to keep an internal copy of it.
2 years ago
Roberto Ierusalimschy
b2f7b3b79f
Control variables in for loops are read only
2 years ago
Roberto Ierusalimschy
540d805226
Towards Lua 5.5
2 years ago
Roberto Ierusalimschy
7d6a97e42b
Dump doesn't need to reuse 'source'
All strings are being reused now, including 'source'.
2 years ago
Roberto Ierusalimschy
d738c8d18b
New function 'luaL_openselectedlibs'
Makes it easier to start Lua with only some standard libraries.
2 years ago