aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Details in the manualRoberto Ierusalimschy2024-06-211-4/+9
|
* Removed 'int' size limit for string.repRoberto Ierusalimschy2024-06-212-16/+5
|
* Removed 'int' size limit for pack/unpackRoberto Ierusalimschy2024-06-212-38/+48
|
* lua_writestring & co. moved to llimits.hRoberto Ierusalimschy2024-06-214-32/+25
| | | | They don't need to be visible by clients of Lua.
* llimits.h being used by all Lua codeRoberto Ierusalimschy2024-06-2014-73/+48
| | | | | | The definitions in llimits.h are useful not only for the core. That header only defines types and '#define's, so libs and core still do not share any real code/data.
* Cleaning of llimits.hRoberto Ierusalimschy2024-06-2019-165/+159
| | | | | | Several definitions that don't need to be "global" (that is, that concerns only specific parts of the code) moved out of llimits.h, to more appropriate places.
* GC test was not restarting collector after pauseRoberto Ierusalimschy2024-06-181-1/+2
|
* 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
| |