aboutsummaryrefslogtreecommitdiff
path: root/lfunc.h (unfollow)
Commit message (Collapse)AuthorFilesLines
2024-11-25Change to macro 'LUAI_TRY'Roberto Ierusalimschy2-8/+7
The call to 'f' is done by the macro, to give it more flexibility.
2024-11-19Debug information about extra arguments from __callRoberto Ierusalimschy9-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.
2024-11-16Counter for length of chains of __call metamethodsRoberto Ierusalimschy4-28/+68
This counter will allow (in a later commit) error messages to correct argument numbers in functions called through __call metamethods.
2024-11-15More integration of 'nresults' into 'callstatus'Roberto Ierusalimschy3-28/+33
2024-11-15'objsize' returns 'l_mem'Roberto Ierusalimschy7-25/+40
Sums of size_t may not fit in a size_t.
2024-11-15New macro 'assert_code'Roberto Ierusalimschy1-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).
2024-11-15Ease slightly making Lua with C89Roberto Ierusalimschy2-1/+8
2024-11-15Dummy node has a non-nil keyRoberto Ierusalimschy1-25/+28
That allows 'getfreepos' to treat it like a regular hash part that has a deleted entry.
2024-11-14Add extra size when resizing tables with deleted keysRoberto Ierusalimschy2-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.
2024-11-13New rule for size of array partRoberto Ierusalimschy3-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.
2024-10-28New structure to count keys in a table for rehashingRoberto Ierusalimschy1-50/+65
2024-10-28Table rehash can resize only the hash partRoberto Ierusalimschy2-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'.
2024-10-24Always use unsigned int for indexing table-arraysRoberto Ierusalimschy2-5/+5
2024-10-23New function 'lua_numbertostrbuff'Roberto Ierusalimschy7-40/+67
It converts a Lua number to a string in a buffer, without creating a new Lua string.
2024-10-23Some changes in default GC parametersRoberto Ierusalimschy2-8/+6
2024-10-21Small bug in 'luaE_luaE_statesize'Roberto Ierusalimschy3-4/+4
Plus, function was renamed to 'luaE_threadsize'.
2024-10-21Better support in 'ltests' for tracing the GCRoberto Ierusalimschy5-30/+67
2024-10-18Some adjustments in transition minor->majorRoberto Ierusalimschy2-37/+46
Plus extra comments and other details.
2024-09-30'objsize' broke in smaller piecesRoberto Ierusalimschy9-63/+91
2024-09-27Local declaration in the REPL generates a warningRoberto Ierusalimschy2-2/+25
2024-09-20No errors in 'luaO_pushvfstring'Roberto Ierusalimschy5-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.
2024-09-20Towards no errors in 'luaO_pushvfstring'Roberto Ierusalimschy1-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.
2024-09-20In 'luaO_pushvfstring', all options use 'addstr2buff'Roberto Ierusalimschy1-12/+8
2024-09-20Removed 'if' left from commit ddfa1fbccfeRoberto Ierusalimschy1-1/+0
2024-09-19Avoid Microsoft warningRoberto Ierusalimschy1-1/+2
> warning C4334: '<<': result of 32-bit shift implicitly converted to > 64 bits (was 64-bit shift intended?)
2024-09-19USHRT_MAX changed to SHRT_MAXRoberto Ierusalimschy2-2/+2
USHRT_MAX does not fit in an 'int' in 16-bit systems.
2024-09-19GC back to controling pace counting bytesRoberto Ierusalimschy11-202/+247
Memory is the resource we want to save. Still to be reviewed again.
2024-09-12DetailsRoberto Ierusalimschy1-3/+3
Fixed comments in sort partition.
2024-09-10Parameter for lua_gc/LUA_GCSTEP changed to 'size_t'Roberto Ierusalimschy3-3/+3
'size_t' is the common type for measuring memory. 'int' can be too small for steps.
2024-09-06Rename of fields in global state that control GCRoberto Ierusalimschy5-32/+32
All fields in the global state that control the pace of the garbage collector prefixed with 'GC'.
2024-09-06DetailsRoberto Ierusalimschy3-20/+20
Identation + comments
2024-08-22Added option for direct correction of stack pointersRoberto Ierusalimschy1-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.
2024-08-20'lcode.c' can use 'checklimit', tooRoberto Ierusalimschy3-12/+10
2024-08-19A return can have at most 254 valuesRoberto Ierusalimschy2-0/+13
2024-08-17Bug: wrong code gen. for indices with comparisonsRoberto Ierusalimschy2-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.
2024-08-02Floats formatted with "correct" precisionRoberto Ierusalimschy3-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".
2024-07-30Struct 'transferinfo' moved to "lua_State"Roberto Ierusalimschy3-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.
2024-07-27'-Wconversion' extended to all options of Lua numbersRoberto Ierusalimschy8-39/+50
2024-07-27Added gcc option '-Wconversion'Roberto Ierusalimschy44-359/+398
No warnings for standard numerical types. Still pending alternative numerical types.
2024-07-21'nresults' moved into 'callstatus'Roberto Ierusalimschy6-62/+79
That gives us more free bits in 'callstatus', for future use.
2024-07-19Using CIST_CLSRET instead of trick with 'nresults'Roberto Ierusalimschy4-30/+31
The callstatus flag CIST_CLSRET is used in all tests for the presence of variables to be closed in C functions.
2024-07-18Explicit limit for number of results in a callRoberto Ierusalimschy3-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.
2024-07-16Maximum stack size may not fit in unsigned shortRoberto Ierusalimschy5-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.
2024-07-05Removed compatibility with "= exp" in the REPLRoberto Ierusalimschy2-5/+2
2024-07-05Fixed bug in 'multiline'Roberto Ierusalimschy2-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.
2024-07-05'printstack' (from ltests.c) made publicRoberto Ierusalimschy2-3/+7
That function is useful for debugging the API.
2024-07-04lua.c loads 'readline' dynamicallyRoberto Ierusalimschy4-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.
2024-07-02Small changes in casts from void* to functionsRoberto Ierusalimschy2-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.
2024-07-01Updated dependencies in the make fileRoberto Ierusalimschy1-15/+23
Mainly to include 'llimits.h' in the non-kernel files
2024-06-28New instruction format for SETLIST/NEWTABLERoberto Ierusalimschy7-47/+97
New instruction format 'ivABC' (a variant of iABC where parameter vC has 10 bits) allows constructors of up to 1024 elements to be coded without EXTRAARG.