aboutsummaryrefslogtreecommitdiff
path: root/llex.c (unfollow)
Commit message (Collapse)AuthorFilesLines
2024-06-12Bug: luaL_traceback may need more than 5 stack slotsRoberto Ierusalimschy3-1/+20
2024-06-12Bug: overlapping assignmentsRoberto Ierusalimschy1-2/+4
ISO C forbids assignment of a union field to another field of the same union.
2024-06-12More disciplined use of 'errno'Roberto Ierusalimschy3-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.
2024-06-10Encoding of table indices (hres) must use C indicesRoberto Ierusalimschy4-24/+30
As the encoding of array indices is (~index), 0 is encoded as -1 and INT_MAX is encoded as INT_MIN.
2024-06-04Bug: Active-lines for stripped vararg functionsRoberto Ierusalimschy3-23/+34
Lua seg. faults when asked to create the 'activelines' table for a vararg function with no debug information.
2024-06-04Manual for 'string.format' lists what it acceptsRoberto Ierusalimschy1-3/+6
Instead of listing what it does not accept, which is always relative.
2024-05-27utf8.offset returns also final position of characterRoberto Ierusalimschy3-31/+55
'utf8.offset' returns two values: the initial and the final position of the given character.
2024-05-23Manual: errors in lua_toclose are not memory errorsRoberto Ierusalimschy3-3/+6
2024-05-08DetailsRoberto Ierusalimschy9-21/+36
Corrections in comments and manual. Added note in the manual about local variables in the REPL.
2024-05-02New year (2024)Roberto Ierusalimschy2-3/+3
2024-04-08'getmode' renamed to 'getMode'Roberto Ierusalimschy1-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.
2024-04-05Yet another representation for arraysRoberto Ierusalimschy3-44/+65
This "linear" representation (see ltable.h for details) has worse locality than cells, but the simpler access code seems to compensate that.
2024-04-03Small simplification in 'findloader'Roberto Ierusalimschy1-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.
2024-03-29Fixed dangling 'StkId' in 'luaV_finishget'Roberto Ierusalimschy5-26/+42
Bug introduced in 05932567.
2024-03-28DetailsRoberto Ierusalimschy2-7/+10
2024-03-22Some 'unsigned int' changed to 'unsigned'Roberto Ierusalimschy9-25/+24
'unsigned int' is too long sometimes. (We already write 'long' instead of 'long int'...)
2024-03-21'luaH_get' functions return tag of the resultRoberto Ierusalimschy10-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.
2024-03-18'luaH_get' functions return 'TValue'Roberto Ierusalimschy9-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.)
2024-03-15Removed "bulk operations"Roberto Ierusalimschy3-57/+14
Negligible performance gains don't justify extra complexity.
2024-03-15Added "bulk operations" to arraysRoberto Ierusalimschy3-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).
2024-03-13DetailsRoberto Ierusalimschy4-6/+5
- 'unsigned int' -> 'unsigned' - Some explicit casts to avoid warnings - Test avoids printing the value of 'fail' (which may not be nil)
2024-03-13Removed type 'varint_t'Roberto Ierusalimschy3-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.)
2024-03-11API asserts for illegal pops of to-be-closed variablesRoberto Ierusalimschy5-30/+45
2024-02-15Fixed warnings from different compilersRoberto Ierusalimschy4-6/+10
2024-02-15New interface to function 'luaL_openselectedlibs'Roberto Ierusalimschy8-56/+80
Instead of preloading all non-loaded libraries, there is another mask to select which libraries to preload.
2024-02-12Revising code for Varint encoding in dumpsRoberto Ierusalimschy3-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.
2024-02-07Removed deprecated function 'setcstacklimit'Roberto Ierusalimschy3-16/+0
2024-02-07Field 'lastfree' changed (back) to 'Node *'Roberto Ierusalimschy1-14/+16
Due to allignment, it is already using the space of a pointer, and a pointer generates slightly simpler code.
2024-02-07Better handling of size limit when resizing a tableRoberto Ierusalimschy6-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.)
2024-01-29DetailsRoberto Ierusalimschy7-24/+25
2024-01-25Small optimization in 'luaH_psetint'Roberto Ierusalimschy2-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.
2024-01-18New function 'table.create'Roberto Ierusalimschy3-2/+45
Creates a table preallocating memory. (It just exports to Lua the API function 'lua_createtable'.)
2024-01-16New mechanism to query GC parametersRoberto Ierusalimschy6-27/+35
2024-01-15Clear interface between references and predefinesRoberto Ierusalimschy7-43/+92
The reference system has a defined way to add initial values to the table where it operates.
2024-01-13Removed uses of LUA_NUMTAGSRoberto Ierusalimschy4-6/+4
That constant was already deprecated (see commit 6aabf4b15e7).
2024-01-12Optimizations for 'lua_rawgeti' and 'lua_rawseti'Roberto Ierusalimschy4-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'.
2024-01-11Bug: Yielding in a hook stops in the wrong instructionRoberto Ierusalimschy3-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.
2024-01-10A few more tweaks in the garbage collectorRoberto Ierusalimschy5-14/+33
2023-12-27Fixed buffers reuse absolute line informationRoberto Ierusalimschy4-13/+36
2023-12-27Several tweaks in the garbage collectorRoberto Ierusalimschy8-56/+98
- back with step size in collectgarbage("step") - adjustments in defaults for some GC parameters - adjustments in 'luaO_codeparam'
2023-12-22Removed compatibility option LUA_COMPAT_GCPARAMSRoberto Ierusalimschy6-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.
2023-12-22New option "setparms" for 'collectgarbage'Roberto Ierusalimschy13-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.
2023-12-21Bug: Buffer overflow in string concatenationRoberto Ierusalimschy2-2/+2
Even if the string fits in size_t, the whole size of the TString object can overflow when we add the header.
2023-12-20GC parameters encoded as floating-point bytesRoberto Ierusalimschy8-57/+113
This encoding brings more precision and a larger range for these parameters.
2023-12-20Option 0 for step multiplier makes GC non-incrementalRoberto Ierusalimschy6-50/+84
2023-12-14Cleaner protocol between 'lua_dump' and writer functionRoberto Ierusalimschy6-46/+66
'lua_dump' signals to the writer function the end of a dump, so that is has more freedom when using the stack.
2023-12-07Check minor->major made at the end of a minor cycleRoberto Ierusalimschy1-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.
2023-12-07First criteria for shifts minor<->majorRoberto Ierusalimschy8-128/+187
2023-12-06Major collections done incrementallyRoberto Ierusalimschy4-75/+80
Major collections do not need to "stop the world". Still pending: criteria for shifts minor-major, shifts generational-incremental.
2023-12-01Removed macro 'changeage'Roberto Ierusalimschy2-14/+12
It is simpler to use always 'setage'. The saving from 'changeage' is too irrelevant.