Commit Graph

138 Commits

Author SHA1 Message Date
Roberto Ierusalimschy
c1dc08e8e8 Length of external strings must fit in Lua integer
(As the length of any string in Lua.)
2024-06-24 12:03:59 -03:00
Roberto Ierusalimschy
0f7025dcae Details in the manual 2024-06-21 16:36:24 -03:00
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.
2024-06-04 17:27:13 -03:00
Roberto Ierusalimschy
b291008cc2 Manual for 'string.format' lists what it accepts
Instead of listing what it does not accept, which is always relative.
2024-06-04 16:51:31 -03:00
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.
2024-05-27 11:29:39 -03:00
Roberto Ierusalimschy
cbdf4969ec Manual: errors in lua_toclose are not memory errors 2024-05-23 09:55:26 -03:00
Roberto Ierusalimschy
262dc5729a Details
Corrections in comments and manual. Added note in the manual about
local variables in the REPL.
2024-05-08 17:50:10 -03:00
Roberto Ierusalimschy
9d985db7bb New year (2024) 2024-05-02 12:03:30 -03:00
Roberto Ierusalimschy
86a8e74824 Details 2024-03-28 17:11:33 -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
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.)
2024-02-07 13:39:54 -03:00
Roberto Ierusalimschy
c31d6774ac Details 2024-01-29 14:29:24 -03:00
Roberto Ierusalimschy
108e0bdc84 Merge branch 'master' into nextversion 2024-01-25 13:52:52 -03:00
Roberto Ierusalimschy
3e9dbe143d New function 'table.create'
Creates a table preallocating memory. (It just exports to Lua the API
function 'lua_createtable'.)
2024-01-18 15:16:26 -03:00
Roberto Ierusalimschy
4a8e480864 New mechanism to query GC parameters 2024-01-16 17:02:55 -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
7827c40c49 A few more tweaks in the garbage collector 2024-01-10 14:45:58 -03:00
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'
2023-12-27 12:09:11 -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
666e95a66d Option 0 for step multiplier makes GC non-incremental 2023-12-20 11:06:27 -03:00
Roberto Ierusalimschy
4eda1acafa Cleaner protocol between 'lua_dump' and writer function
'lua_dump' signals to the writer function the end of a dump, so that
is has more freedom when using the stack.
2023-12-14 11:41:57 -03:00
Roberto Ierusalimschy
925fe8a0f2 First criteria for shifts minor<->major 2023-12-07 15:45:11 -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
011850a8f8 Details in the manual 2023-11-24 14:44:38 -03:00
Roberto Ierusalimschy
3b57e37e48 Fixed buffers save long strings as external. 2023-11-10 12:35:48 -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
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
c815c2f0eb Merge branch 'master' into nextversion 2023-08-23 15:14:03 -03:00
Roberto Ierusalimschy
9363a8b990 Documentation for "LUA_NOENV"
Registry field "LUA_NOENV" (that signals to libraries that option -E
is on) now part of the "official" API of Lua stand-alone.
2023-08-23 13:50:38 -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
e15f1f2bb7 Details
Typos in comments and details in the manual.
2023-04-18 09:44:10 -03:00
Roberto Ierusalimschy
b5c65705ca New year (2023)
Also, small tweak in makefile. (-Wsign-compare is already enabled by
-Wextra.)
2023-03-31 11:47:31 -03:00
Roberto Ierusalimschy
86e8039a72 Clock component removed from 'luaL_makeseed'
'clock' can be quite slow on some machines.
2023-03-23 16:01:16 -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
b2f7b3b79f Control variables in for loops are read only 2022-12-21 12:04:59 -03:00
Roberto Ierusalimschy
540d805226 Towards Lua 5.5 2022-12-20 13:24:43 -03:00
Roberto Ierusalimschy
1e64c1391f Bug: stack overflow with nesting of coroutine.close 2022-10-25 16:44:06 -03:00
Roberto Ierusalimschy
c954db3924 Option '-l g=mod' added to the manual
Plus some other improvements in the manual.
2022-10-19 16:30:39 -03:00
Roberto Ierusalimschy
71bc69c2af Note in the manual about using '...' as an expression 2022-09-08 17:21:02 -03:00
Roberto Ierusalimschy
c6cea857a4 Better documentation for 'multires' expressions
Manual has a new section explaining multires expressions, lists of
expressions, and adjustments. This commit also corrects some comments
in the code.
2022-08-19 14:10:18 -03:00
Roberto Ierusalimschy
e435aaabef Details (identation and typos) 2022-05-10 11:13:39 -03:00
Roberto Ierusalimschy
f3cfd5bf2b Details
Comments + manual + identation + asserts about stack limits that were
not allowing the use of the full stack
2022-04-01 13:55:44 -03:00
Roberto Ierusalimschy
5d708c3f9c Explanation of borders in the manual
The explanation includes the limit case of maxinteger being a border.
It also avoids the term "natural", which might include large floats
with natural values.
2022-01-13 08:15:03 -03:00
Roberto Ierusalimschy
05ac2409ee New year (2022) 2022-01-02 07:11:08 -03:00
Roberto Ierusalimschy
0bfc572e51 Bug: GC is not reentrant
As the GC is not reentrant, finalizers should not be able to invoke it.
2021-12-13 10:41:17 -03:00
Roberto Ierusalimschy
6b3e116d44 Corrected bug in 'luaD_tryfuncTM'
The pointer to the metamethod can be invalidated by a finalizer that
can run during a GC in 'checkstackGCp'. (This commit also fixes a
detail in the manual.) Bug introduced in commit 91673a8ec.
2021-11-16 14:35:06 -03:00
Roberto Ierusalimschy
87a9573b2e Documentation
Better explanation about the guaranties of multiple assignment in
the manual.
2021-10-11 13:49:13 -03:00
Roberto Ierusalimschy
9db4bfed6b Revamp of format validation in 'string.format'
When calling 'sprintf', not all conversion specifiers accept all
flags; some combinations are undefined behavior.
2021-09-03 13:14:56 -03:00
Roberto Ierusalimschy
e2c07dcbf7 Improved documentation for 'lua_getinfo' 2021-08-11 11:18:10 -03:00