| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
|
|
|
|
|
|
| |
Still missing:
- handling of memory errors when creating upvalue (must run closing
method all the same)
- interaction with coroutines
|
|
|
|
|
|
|
|
|
|
|
|
| |
Start of the implementation of "scoped variables" or "to be closed"
variables, local variables whose '__close' (or themselves) are called
when they go out of scope. This commit implements the syntax, the
opcode, and the creation of the corresponding upvalue, but it still
does not call the finalizations when the variable goes out of scope
(the most important part).
Currently, the syntax is 'local scoped name = exp', but that will
probably change.
|
|
|
|
|
|
|
|
|
| |
Resuming a coroutine uses more C stack than other operations (such as
function calls or recursive syntax). So, to avoid stack overflow
in recursive coroutine invocations, either LUAI_MAXCCALLS must be
too small or a coroutine invocation must "pay" a higher price.
New constant LUAL_COROCSTK ("COROutine C STaK") defines how much
is this price.
|
| |
|
|
|
|
|
|
|
|
|
| |
The multiplication (m*b) used to test whether 'm' is non-zero and
'm' and 'b' have different signs can underflow for very small numbers,
giving a wrong result. The use of explicit comparisons solves this
problem. This commit also adds several new tests for '%' (both for
floats and for integers) to exercise more corner cases, such as
very large and very small values.
|
|
|
|
|
|
|
|
|
|
|
| |
As hinted in the manual for Lua 5.3, the emulation of the metamethod
for '__le' using '__le' has been deprecated. It is slow, complicates
the logic, and it is easy to avoid this emulation by defining a proper
'__le' function.
Moreover, often this emulation was used wrongly, with a programmer
assuming that an order is total when it is not (e.g., NaN in
floating-point numbers).
|
|
|
|
|
| |
Version numbers and dates (mostly wrong) from RCS keyword strings
removed from all source files; only the file name are kept.
|
|
|
|
|
| |
Minor optimizations in 'lvm.c'. (Not exactly optimizations, but more
chances for optimizations.)
|
|
|
|
|
|
| |
Some old systems (e.g., Mac OS X 10.4) do not define
'rl_inhibit_completion', even when line history is available.
Anyway, the user can configure this option externally, using '~/.inputrc'.
|
|
|
|
|
|
|
|
| |
These operations also can give errors for lack of resources, so they
also will try "emergency collections" in case of resource errors.
Because there are now two libraries with that kind of handling,
'resourcetryagain' was moved to the auxiliary library to be shared
by the libraries.
|
|
|
|
|
|
|
| |
From the point of view of 'git', all names are relative to the root
directory of the project. So, file names in '$Id:' also should be
relative to that directory: the proper name for test file 'all.lua'
is 'testes/all.lua'.
|
| |
|
|
|
|
|
|
|
|
|
| |
If a file operation fails do to lack of resources (too many open
files or not enough memory), it does a full garbage collection and
tries the operation again. Lack of resources are "too many open
files" (process wise and system wise) and "not enough memory".
The code is full of '#if's because error codes are not part
of the standard ISO C.
|
|
|
|
|
| |
Improved the comments in file 'lgc.c' explaining the roles of "ages"
OLD0 and OLD1 in the generacional collector.
|
|
|
|
|
|
|
|
|
| |
During generational collection, a userdatum must become gray and
go to a gray list after being traversed (like tables), so that
'correctgraylist' can handle it to its next stage.
This commit also added minimum tests for the generational collector,
including one that would detect this bug.
|
|
|
|
|
|
| |
An 'int' may have only 16 bits, so it may not be big enough for UTF-8
values. The new type 'utfint' (in the utf8 library) ensures at least
21 bits for those values.
|
|
|
|
|
|
|
|
| |
The counter 'nCcalls' now includes the number of CallInfo structures
pre-allocated (so that these "potential" C calls can be made without
checking 'nCcalls'). So, when copying this value from a thread to
another, in 'lua_resume', it must be corrected to the number of
CallInfo structures in the thread being resumed.
|
|
|
|
|
| |
LUA_VERSION_RELEASE_NUM is set to the release number of the Lua
interpreter (e.g., 5.4.0 becomes the integer 50400).
|
|
|
|
|
|
|
|
|
| |
When creating code for a jump on a 'not' condition, the code generator
was removing an instruction (the OP_NOT) without adjusting its
corresponding line information.
This fix also added tests for this case and extra functionality in
the test library to debug line info. structures.
|
| |
|
|
|
|
|
|
| |
- More precise use of 'argument' x 'parameter'.
- Clarification about what the lexer considers 'letter', 'space',
and 'digit'.
|
| |
|
|
|
|
|
|
|
|
| |
When Lua is building large long-duration structures, frequent small
minor collections just waste time. Trying to avoid this, the
collector will do a larger pause after a major collection when it
does not collect enough garbage (which is a hint that memory is
being used for long-lasting objects).
|
|
|
|
|
|
|
| |
When creating error messages, package loaders may create dozens of
temporary strings (one or more for each tried template). This change
reduces the number of these strings, and avoid creating some of
them if the search is successful.
|
|
|
|
|
| |
This commit only removed the file 'lbitlib.c' from the project; the
makefile already was not using it.
|
|
|
|
|
|
|
| |
The array with the names of the opcodes was moved to a header file
('lopnames.h'), as it is not used by the Lua kernel. Files that need
that array ('luac.c' and 'ltests.c') include the header file to get
a private (static) copy.
|
|
|
|
|
| |
Opocode was using 'luai_numdiv' (float division) instead of
'luai_numidiv' (integer division).
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
during any memory allocation +
'luaT_getvarargs' may reallocate the stack, and therefore the top must
be correct.
|
|
|
|
| |
during any memory allocation.
|
|
|
|
| |
+ change in 'LUAMOD_API' as opening functions do not need to be global
|
|
|
|
| |
Lua should work correctly with several copies of the kernel
|
|
|
|
| |
addresses of static variables
|
|
|
|
| |
macro 'api_checkvalidindex' (used only once) expanded and removed
|
| |
|
| |
|
|
|
|
| |
be used as a hint for '#t'
|
| |
|
|
|
|
| |
constants
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
(now uses static variables)
|
|
|
|
|
| |
(instead, use a different kind of nil to signal the fake entry returned
when a key is not found in a table)
|
| |
|