aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Avoid an extra call to 'concretesize' in 'resizearray'Roberto Ierusalimschy2024-11-271-5/+5
|
* Change to macro 'LUAI_TRY'Roberto Ierusalimschy2024-11-252-8/+7
| | | | The call to 'f' is done by the macro, to give it more flexibility.
* Debug information about extra arguments from __callRoberto Ierusalimschy2024-11-199-12/+83
| | | | | | '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.
* Counter for length of chains of __call metamethodsRoberto Ierusalimschy2024-11-164-28/+68
| | | | | This counter will allow (in a later commit) error messages to correct argument numbers in functions called through __call metamethods.
* More integration of 'nresults' into 'callstatus'Roberto Ierusalimschy2024-11-153-28/+33
|
* 'objsize' returns 'l_mem'Roberto Ierusalimschy2024-11-157-25/+40
| | | | Sums of size_t may not fit in a size_t.
* New macro 'assert_code'Roberto Ierusalimschy2024-11-151-5/+6
| | | | | It allows code that is only used by assertions but that are not assertions (e.g., declaration of a variable used in a later assertion).
* Ease slightly making Lua with C89Roberto Ierusalimschy2024-11-152-1/+8
|
* Dummy node has a non-nil keyRoberto Ierusalimschy2024-11-151-25/+28
| | | | | That allows 'getfreepos' to treat it like a regular hash part that has a deleted entry.
* Add extra size when resizing tables with deleted keysRoberto Ierusalimschy2024-11-142-6/+82
| | | | | | | | Without this extra space, sequences of insertions/deletions (and some other uses) can have unpexpected low performances. See the added tests for an example, and *Mathematical Models to Analyze Lua Hybrid Tables and Why They Need a Fix* (Martínez, Nicaud, Rotondo; arXiv:2208.13602v2) for detais.
* New rule for size of array partRoberto Ierusalimschy2024-11-133-29/+81
| | | | | | | | 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.
* New structure to count keys in a table for rehashingRoberto Ierusalimschy2024-10-281-50/+65
|
* Table rehash can resize only the hash partRoberto Ierusalimschy2024-10-282-17/+41
| | | | | | | If there are no integer keys outside the array part, there is no reason to resize it, saving the time to count its elements. Moreover, assignments to non-integer keys will not collapse a table created with 'table.create'.
* Always use unsigned int for indexing table-arraysRoberto Ierusalimschy2024-10-242-5/+5
|
* New function 'lua_numbertostrbuff'Roberto Ierusalimschy2024-10-237-40/+67
| | | | | It converts a Lua number to a string in a buffer, without creating a new Lua string.
* Some changes in default GC parametersRoberto Ierusalimschy2024-10-232-8/+6
|
* Small bug in 'luaE_luaE_statesize'Roberto Ierusalimschy2024-10-213-4/+4
| | | | Plus, function was renamed to 'luaE_threadsize'.
* Better support in 'ltests' for tracing the GCRoberto Ierusalimschy2024-10-215-30/+67
|
* Some adjustments in transition minor->majorRoberto Ierusalimschy2024-10-182-37/+46
| | | | Plus extra comments and other details.
* 'objsize' broke in smaller piecesRoberto Ierusalimschy2024-09-309-63/+91
|
* Local declaration in the REPL generates a warningRoberto Ierusalimschy2024-09-272-2/+25
|
* No errors in 'luaO_pushvfstring'Roberto Ierusalimschy2024-09-205-24/+45
| | | | | | Any call to 'va_start' must have a corresponding call to 'va_end'; so, functions called between them (luaO_pushvfstring in particular) cannot raise errors.
* Towards no errors in 'luaO_pushvfstring'Roberto Ierusalimschy2024-09-201-52/+69
| | | | | | Any call to 'va_start' must have a corresponding call to 'va_end'; so, functions called between them (luaO_pushvfstring in particular) cannot raise errors.
* In 'luaO_pushvfstring', all options use 'addstr2buff'Roberto Ierusalimschy2024-09-201-12/+8
|
* Removed 'if' left from commit ddfa1fbccfeRoberto Ierusalimschy2024-09-201-1/+0
|
* Avoid Microsoft warningRoberto Ierusalimschy2024-09-191-1/+2
| | | | | > warning C4334: '<<': result of 32-bit shift implicitly converted to > 64 bits (was 64-bit shift intended?)
* USHRT_MAX changed to SHRT_MAXRoberto Ierusalimschy2024-09-192-2/+2
| | | | USHRT_MAX does not fit in an 'int' in 16-bit systems.
* GC back to controling pace counting bytesRoberto Ierusalimschy2024-09-1911-202/+247
| | | | Memory is the resource we want to save. Still to be reviewed again.
* DetailsRoberto Ierusalimschy2024-09-121-3/+3
| | | | Fixed comments in sort partition.
* Parameter for lua_gc/LUA_GCSTEP changed to 'size_t'Roberto Ierusalimschy2024-09-103-3/+3
| | | | | 'size_t' is the common type for measuring memory. 'int' can be too small for steps.
* Rename of fields in global state that control GCRoberto Ierusalimschy2024-09-065-32/+32
| | | | | All fields in the global state that control the pace of the garbage collector prefixed with 'GC'.
* DetailsRoberto Ierusalimschy2024-09-063-20/+20
| | | | Identation + comments
* Added option for direct correction of stack pointersRoberto Ierusalimschy2024-08-221-10/+44
| | | | | | | | | | The use of a pointer (not access, only for computations) after its deallocation is forbiden in ISO C, but seems to work fine in all platforms we are aware of. So, using that to correct stack pointers after a stack reallocation seems safe and is much simpler than the current implementation (first change all pointers to offsets and then changing the offsets back to pointers). Anyway, for now that option is disabled.
* 'lcode.c' can use 'checklimit', tooRoberto Ierusalimschy2024-08-203-12/+10
|
* A return can have at most 254 valuesRoberto Ierusalimschy2024-08-192-0/+13
|
* Bug: wrong code gen. for indices with comparisonsRoberto Ierusalimschy2024-08-172-1/+10
| | | | | | | In function 'luaK_exp2val', used to generate code for indices: Macro 'hasjumps' does not consider the case when the whole expression is a "jump" (a test). In all other of its uses, the surrounding code ensures that the expression cannot be VJMP.
* Floats formatted with "correct" precisionRoberto Ierusalimschy2024-08-023-21/+153
| | | | | | Conversion float->string ensures that, for any float f, tonumber(tostring(f)) == f, but still avoiding noise like 1.1 converting to "1.1000000000000001".
* Struct 'transferinfo' moved to "lua_State"Roberto Ierusalimschy2024-07-303-24/+16
| | | | | | That reduces the size of "CallInfo". Moreover, bit CIST_HOOKED from call status is not needed. When in a hook, 'transferinfo' is always valid, being zero when the hook is not call/return.
* '-Wconversion' extended to all options of Lua numbersRoberto Ierusalimschy2024-07-278-39/+50
|
* Added gcc option '-Wconversion'Roberto Ierusalimschy2024-07-2744-359/+398
| | | | | No warnings for standard numerical types. Still pending alternative numerical types.
* 'nresults' moved into 'callstatus'Roberto Ierusalimschy2024-07-216-62/+79
| | | | That gives us more free bits in 'callstatus', for future use.
* Using CIST_CLSRET instead of trick with 'nresults'Roberto Ierusalimschy2024-07-194-30/+31
| | | | | The callstatus flag CIST_CLSRET is used in all tests for the presence of variables to be closed in C functions.
* Explicit limit for number of results in a callRoberto Ierusalimschy2024-07-183-4/+17
| | | | | | The parameter 'nresults' in 'lua_call' and similar functions has a limit of 250. It already had an undocumented (and unchecked) limit of SHRT_MAX, but it is seldom larger than 2.
* Maximum stack size may not fit in unsigned shortRoberto Ierusalimschy2024-07-165-28/+46
| | | | | | Therefore, fields ftransfer/ntransfer in lua_Debug must have type 'int'. (Maximum stack size must fit in an 'int'.) Also, this commit adds check that maximum stack size respects size_t for size in bytes.
* Removed compatibility with "= exp" in the REPLRoberto Ierusalimschy2024-07-052-5/+2
|
* Fixed bug in 'multiline'Roberto Ierusalimschy2024-07-052-14/+19
| | | | | | '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.
* 'printstack' (from ltests.c) made publicRoberto Ierusalimschy2024-07-052-3/+7
| | | | That function is useful for debugging the API.
* lua.c loads 'readline' dynamicallyRoberto Ierusalimschy2024-07-044-29/+90
| | | | | | | (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.
* Small changes in casts from void* to functionsRoberto Ierusalimschy2024-07-022-22/+26
| | | | | | Macro moved to llimits.h, and casts from void* to lua_CFunction first go through 'voidf' (a pointer to a function from void to void), a kind of void* for functions.
* Updated dependencies in the make fileRoberto Ierusalimschy2024-07-011-15/+23
| | | | Mainly to include 'llimits.h' in the non-kernel files