aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* Tricky _PROMPT may trigger undefined behavior in lua.cRoberto Ierusalimschy2024-06-121-2/+3
|
* Bug: luaL_traceback may need more than 5 stack slotsRoberto Ierusalimschy2024-06-123-1/+20
|
* Bug: overlapping assignmentsRoberto Ierusalimschy2024-06-121-2/+4
| | | | | ISO C forbids assignment of a union field to another field of the same union.
* More disciplined use of 'errno'Roberto Ierusalimschy2024-06-123-10/+33
| | | | | | | | | Set errno to zero before calling any function where we may use its errno, and check errno for zero before using it (as functions may not set it even in error). The code assumes that no function will put garbage on errno (although ISO C allows that): If any function during an operation set errno, and the operation result in an error, assume that errno has something to say.
* Encoding of table indices (hres) must use C indicesRoberto Ierusalimschy2024-06-104-24/+30
| | | | | As the encoding of array indices is (~index), 0 is encoded as -1 and INT_MAX is encoded as INT_MIN.
* Bug: Active-lines for stripped vararg functionsRoberto Ierusalimschy2024-06-043-23/+34
| | | | | Lua seg. faults when asked to create the 'activelines' table for a vararg function with no debug information.
* Manual for 'string.format' lists what it acceptsRoberto Ierusalimschy2024-06-041-3/+6
| | | | Instead of listing what it does not accept, which is always relative.
* utf8.offset returns also final position of characterRoberto Ierusalimschy2024-05-273-31/+55
| | | | | 'utf8.offset' returns two values: the initial and the final position of the given character.
* Manual: errors in lua_toclose are not memory errorsRoberto Ierusalimschy2024-05-233-3/+6
|
* DetailsRoberto Ierusalimschy2024-05-089-21/+36
| | | | | Corrections in comments and manual. Added note in the manual about local variables in the REPL.
* New year (2024)Roberto Ierusalimschy2024-05-022-3/+3
|
* 'getmode' renamed to 'getMode'Roberto Ierusalimschy2024-04-081-3/+3
| | | | | | The name 'getmode' conficts with a function from BSD, defined in <unistd.h>. Although 'lbaselib.c' cannot include that header, 'onelua.c' can.
* Yet another representation for arraysRoberto Ierusalimschy2024-04-053-44/+65
| | | | | | This "linear" representation (see ltable.h for details) has worse locality than cells, but the simpler access code seems to compensate that.
* Small simplification in 'findloader'Roberto Ierusalimschy2024-04-031-5/+4
| | | | | Instead of allways adding a prefix for the next message, and then removing it if there is no message, add the prefix after each message.
* Fixed dangling 'StkId' in 'luaV_finishget'Roberto Ierusalimschy2024-03-295-26/+42
| | | | Bug introduced in 05932567.
* DetailsRoberto Ierusalimschy2024-03-282-7/+10
|
* Some 'unsigned int' changed to 'unsigned'Roberto Ierusalimschy2024-03-229-25/+24
| | | | | 'unsigned int' is too long sometimes. (We already write 'long' instead of 'long int'...)
* 'luaH_get' functions return tag of the resultRoberto Ierusalimschy2024-03-2110-132/+138
| | | | | | | Undoing previous commit. Returning TValue increases code size without any visible gains. Returning the tag is a little simpler than returning a special code (HOK/HNOTFOUND) and the tag is useful by itself in some cases.
* 'luaH_get' functions return 'TValue'Roberto Ierusalimschy2024-03-189-122/+124
| | | | | | Instead of receiving a parameter telling them where to put the result of the query, these functions return the TValue directly. (That is, they return a structure.)
* Removed "bulk operations"Roberto Ierusalimschy2024-03-153-57/+14
| | | | Negligible performance gains don't justify extra complexity.
* Added "bulk operations" to arraysRoberto Ierusalimschy2024-03-153-35/+99
| | | | | A few operations on arrays can be performed "in bulk", treating all tags of a cell as a simple (or a few) word(s).
* DetailsRoberto Ierusalimschy2024-03-134-6/+5
| | | | | | - 'unsigned int' -> 'unsigned' - Some explicit casts to avoid warnings - Test avoids printing the value of 'fail' (which may not be nil)
* Removed type 'varint_t'Roberto Ierusalimschy2024-03-133-32/+23
| | | | | | size_t should be big enough to count the number of strings in a dump. (And, by definition, it is big enough to count the length of each string.)
* API asserts for illegal pops of to-be-closed variablesRoberto Ierusalimschy2024-03-115-30/+45
|
* Fixed warnings from different compilersRoberto Ierusalimschy2024-02-154-6/+10
|
* New interface to function 'luaL_openselectedlibs'Roberto Ierusalimschy2024-02-158-56/+80
| | | | | Instead of preloading all non-loaded libraries, there is another mask to select which libraries to preload.
* Revising code for Varint encoding in dumpsRoberto Ierusalimschy2024-02-123-29/+45
| | | | | | | | - Usign lua_Unsigned to count strings. - Varint uses a type large enough both for size_t and lua_Unsigned. - Most-Significant Bit 0 means last byte, to conform to common usage. - (unrelated) Change in macro 'getaddr' so that multiplication is by constants.
* Removed deprecated function 'setcstacklimit'Roberto Ierusalimschy2024-02-073-16/+0
|
* Field 'lastfree' changed (back) to 'Node *'Roberto Ierusalimschy2024-02-071-14/+16
| | | | | Due to allignment, it is already using the space of a pointer, and a pointer generates slightly simpler code.
* Better handling of size limit when resizing a tableRoberto Ierusalimschy2024-02-076-21/+37
| | | | | | | | 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.)
* DetailsRoberto Ierusalimschy2024-01-297-24/+25
|
* Merge branch 'master' into nextversionRoberto Ierusalimschy2024-01-258-12/+27
|\
| * Bug: Yielding in a hook stops in the wrong instructionRoberto Ierusalimschy2024-01-113-6/+11
| | | | | | | | | | | | | | | | Yielding in a hook must decrease the program counter, because it already counted an instruction that, in the end, was not executed. However, that decrement should be done only when about to restart the thread. Otherwise, inspecting the thread with the debug library shows it one instruction behind of where it really is.
| * Bug: Buffer overflow in string concatenationRoberto Ierusalimschy2023-12-212-2/+2
| | | | | | | | | | Even if the string fits in size_t, the whole size of the TString object can overflow when we add the header.
| * Panic functions should not raise errorsRoberto Ierusalimschy2023-11-243-4/+14
| | | | | | | | | | The standard panic function was using 'lua_tostring', which may raise a memory-allocation error if error value is a number.
* | Small optimization in 'luaH_psetint'Roberto Ierusalimschy2024-01-252-4/+5
| | | | | | | | | | | | It is quite common to write to empty but existing cells in the array part of a table, so 'luaH_psetint' checks for the common case that the table doesn't have a newindex metamethod to complete the write.
* | New function 'table.create'Roberto Ierusalimschy2024-01-183-2/+45
| | | | | | | | | | Creates a table preallocating memory. (It just exports to Lua the API function 'lua_createtable'.)
* | New mechanism to query GC parametersRoberto Ierusalimschy2024-01-166-27/+35
| |
* | Clear interface between references and predefinesRoberto Ierusalimschy2024-01-157-43/+92
| | | | | | | | | | The reference system has a defined way to add initial values to the table where it operates.
* | Removed uses of LUA_NUMTAGSRoberto Ierusalimschy2024-01-134-6/+4
| | | | | | | | That constant was already deprecated (see commit 6aabf4b15e7).
* | Optimizations for 'lua_rawgeti' and 'lua_rawseti'Roberto Ierusalimschy2024-01-124-49/+80
| | | | | | | | | | | | 'lua_rawgeti' now uses "fast track"; 'lua_rawseti' still calls 'luaH_setint', but the latter was recoded to avoid extra overhead when writing to the array part after 'alimit'.
* | A few more tweaks in the garbage collectorRoberto Ierusalimschy2024-01-105-14/+33
| |
* | Fixed buffers reuse absolute line informationRoberto Ierusalimschy2023-12-274-13/+36
| |
* | Several tweaks in the garbage collectorRoberto Ierusalimschy2023-12-278-56/+98
| | | | | | | | | | | | - back with step size in collectgarbage("step") - adjustments in defaults for some GC parameters - adjustments in 'luaO_codeparam'
* | Removed compatibility option LUA_COMPAT_GCPARAMSRoberto Ierusalimschy2023-12-226-53/+20
| | | | | | | | | | | | The meaning of different GC parameters changed, so there is point in supporting old values for them. The new code simply ignores the parameters when changing the GC mode, so the incompatibility is small.
* | New option "setparms" for 'collectgarbage'Roberto Ierusalimschy2023-12-2213-78/+163
| | | | | | | | | | | | 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.
* | GC parameters encoded as floating-point bytesRoberto Ierusalimschy2023-12-208-57/+113
| | | | | | | | | | This encoding brings more precision and a larger range for these parameters.
* | Option 0 for step multiplier makes GC non-incrementalRoberto Ierusalimschy2023-12-206-50/+84
| |
* | Cleaner protocol between 'lua_dump' and writer functionRoberto Ierusalimschy2023-12-146-46/+66
| | | | | | | | | | 'lua_dump' signals to the writer function the end of a dump, so that is has more freedom when using the stack.
* | Check minor->major made at the end of a minor cycleRoberto Ierusalimschy2023-12-071-60/+35
| | | | | | | | | | It does not make sense to wait for another cycle to decide when much of the information about creation of old objects is already available.