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
Roberto Ierusalimschy
8a32e0aa4a
Correction on documentation of string-buffer operations
...
All string-buffer operations can potentially change the stack in
unspecified ways; the push/pop documentation in the manual should
reflect that.
2021-07-21 11:33:58 -03:00
Roberto Ierusalimschy
c0ed74c1e1
Avoid the term "undefined behavior" in the manual
2021-06-09 13:24:49 -03:00
Roberto Ierusalimschy
bef250eb8d
Details
...
Comments and small improvements in the manual.
2021-03-29 11:47:12 -03:00
Roberto Ierusalimschy
511d53a826
lua_settop/lua_pop closes to-be-closed variables
...
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.
2021-03-09 11:42:45 -03:00
Roberto Ierusalimschy
e7803f7dbc
New release number (5.4.3)
2021-03-03 09:44:20 -03:00
Roberto Ierusalimschy
b7eb21c1ef
Normalization of metamethod typography in the manual
2021-03-02 13:50:00 -03:00
Roberto Ierusalimschy
bc970005ce
'__close' methods can yield in the return of a C function
...
When, inside a coroutine, a C function with to-be-closed slots return,
the corresponding metamethods can yield. ('__close' metamethods called
through 'lua_closeslot' still cannot yield, as there is no continuation
to go when resuming.)
2021-02-12 13:36:30 -03:00
Roberto Ierusalimschy
6ccd24eff5
Simpler handling of errors when creating tbc variables
...
New field 'lua_State.ptbc' keeps to-be-closed variable until its
upvalue is created, so that it can be closed in case of a
memory-allocation error.
2021-01-19 10:03:13 -03:00
Roberto Ierusalimschy
825ac8eca8
Corrected documentation for 'table.sort'
...
The sort function must define a (strict) weak order for a correct
sorting. A partial order is not enough.
2021-01-14 13:26:55 -03:00
Roberto Ierusalimschy
cc1692515e
New API function 'lua_closeslot'
...
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.
2021-01-11 15:03:01 -03:00
Roberto Ierusalimschy
0ceada8da9
Report last error in closing methods
...
When there are multiple errors around closing methods, report the
last error instead of the original.
2020-12-22 10:54:25 -03:00
Roberto Ierusalimschy
f9d29b0c44
Upvalues removed from 'openupval' before being closed
...
Undo commit c220b0a5d0: '__close' is not called again in case of
errors. (Upvalue is removed from the list before the call.) The
common error that justified that change was C stack overflows, which
are much rarer with the stackless implementation.
2020-12-21 15:21:45 -03:00