aboutsummaryrefslogtreecommitdiff
path: root/lobject.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* DetailsRoberto Ierusalimschy2025-02-261-4/+4
| | | | | Comments, small changes in the manual, an extra test for errors in error handling, small changes in tests.
* Fixed conversion warnings from clangRoberto Ierusalimschy2025-01-141-0/+1
| | | | | Plus some other details. (Option '-Wuninitialized' was removed from the makefile because it is already enabled by -Wall.)
* New function 'lua_numbertostrbuff'Roberto Ierusalimschy2024-10-231-21/+23
| | | | | It converts a Lua number to a string in a buffer, without creating a new Lua string.
* No errors in 'luaO_pushvfstring'Roberto Ierusalimschy2024-09-201-13/+24
| | | | | | 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
|
* GC back to controling pace counting bytesRoberto Ierusalimschy2024-09-191-6/+6
| | | | Memory is the resource we want to save. Still to be reviewed again.
* Floats formatted with "correct" precisionRoberto Ierusalimschy2024-08-021-13/+39
| | | | | | Conversion float->string ensures that, for any float f, tonumber(tostring(f)) == f, but still avoiding noise like 1.1 converting to "1.1000000000000001".
* Added gcc option '-Wconversion'Roberto Ierusalimschy2024-07-271-32/+36
| | | | | No warnings for standard numerical types. Still pending alternative numerical types.
* DetailsRoberto Ierusalimschy2024-01-291-10/+16
|
* Several tweaks in the garbage collectorRoberto Ierusalimschy2023-12-271-9/+9
| | | | | | - back with step size in collectgarbage("step") - adjustments in defaults for some GC parameters - adjustments in 'luaO_codeparam'
* GC parameters encoded as floating-point bytesRoberto Ierusalimschy2023-12-201-1/+52
| | | | | This encoding brings more precision and a larger range for these parameters.
* More disciplined use of 'getstr' and 'tsslen'Roberto Ierusalimschy2023-08-171-1/+1
| | | | | We may want to add other string variants in the future; this change documents better where the code may need to handle those variants.
* Stack indices changed to union'sRoberto Ierusalimschy2022-10-291-3/+3
| | | | | That will allow to change pointers to offsets while reallocating the stack.
* Negation in constant folding of '>>' may overflowRoberto Ierusalimschy2022-09-231-1/+1
|
* More checks and documentation for uses of EXTRA_STACKRoberto Ierusalimschy2022-05-261-12/+22
|
* DetailRoberto Ierusalimschy2022-01-031-5/+5
| | | | Warnings with clang when using long double for Lua floats.
* 'luaL_newstate' should not allocate extra memoryRoberto Ierusalimschy2020-11-031-1/+1
| | | | | | | | The allocation of a userdata for the state of the warn system can cause a panic if it fails; 'luaL_ref' also can fail. This commit re-implements the warn system so that it does not need an explicit state. Instead, the system uses different functions to represent the different states.
* DetailsRoberto Ierusalimschy2020-07-031-8/+13
| | | | Comments in makefile and function 'l_str2d'.
* 'luaV_concat' can "concat" one single valueRoberto Ierusalimschy2020-07-031-4/+2
| | | | | Several of its callers needed that case and had to do the check themselves.
* Simplification and smaller buffers for 'lua_pushfstring'Roberto Ierusalimschy2020-07-031-10/+16
| | | | | The function 'lua_pushfstring' is seldom called with large strings, there is no need to optimize too much for that cases.
* Undo change in the handling of 'L->top' (commit b80077b8f3)Roberto Ierusalimschy2019-08-291-2/+0
| | | | | | With MMBIN instructions, there are fewer opcodes that need to update 'L->top', so that change does not seem to pay for the increased complexity.
* Change in the handling of 'L->top' when calling metamethodsRoberto Ierusalimschy2019-07-261-0/+2
| | | | | | | Instead of updating 'L->top' in every place that may call a metamethod, the metamethod functions themselves (luaT_trybinTM and luaT_callorderTM) correct the top. (When calling metamethods from the C API, however, the callers must preserve 'L->top'.)
* OP_NEWTABLE keeps exact size of arraysRoberto Ierusalimschy2019-07-121-26/+0
| | | | | | OP_NEWTABLE is followed by an OP_EXTRAARG, so that it can keep the exact size of the array part of the table to be created. (Functions 'luaO_int2fb'/'luaO_fb2int' were removed.)
* DetailsRoberto Ierusalimschy2019-06-031-9/+9
| | | | | Several small changes from feedback on 5.4 alhpa rc1 (warnings, typos in the manual, and the like)
* DetailsRoberto Ierusalimschy2019-05-281-2/+2
| | | | | | | - new error message for "attempt to assign to const variable" - note in the manual about compatibility options - comments - small changes in 'read_line' and 'pushstr'
* A few more improvements in 'luaO_pushvfstring'Roberto Ierusalimschy2019-05-031-29/+37
| | | | | | | | - 'L' added to the 'BuffFS' structure - '%c' does not handle control characters (it is not its business. This now is done by the lexer, who is the one in charge of that kind of errors.) - avoid the direct use of 'l_sprintf' in the Lua kernel
* Some more small improvements to 'luaO_pushvfstring'Roberto Ierusalimschy2019-04-261-54/+68
| | | | | | | Details: - counter 'pushed' moved to the struct 'BuffFS' - new auxiliar function 'getbuff' to build strings directly on the buffer.
* Revamp of 'lua_pushfstring' / 'luaO_pushvfstring'Roberto Ierusalimschy2019-04-241-37/+107
| | | | | | | | | The function 'luaO_pushvfstring' now uses an internal buffer to concatenate small strings, instead of pushing all pieces on the stack. This avoids the creation of several small Lua strings for each piece of the result. (For instance, a format like "n: '%d'" used to create three intermediate strings: "n: '", the numeral, and "'". Now it creates none.)
* Added field 'srclen' to structure 'lua_Debug'Roberto Ierusalimschy2019-04-041-15/+12
| | | | | | This new field gets the length of 'source' in the same structure. Unlike the other strings in that structure, 'source' can be relatively large, and Lua already has its length readily available.
* Changes in the validation of UTF-8Roberto Ierusalimschy2019-03-151-3/+3
| | | | | | | | | | | All UTF-8 encoding functionality (including the escape sequence '\u') accepts all values from the original UTF-8 specification (with sequences of up to six bytes). By default, the decoding functions in the UTF-8 library do not accept invalid Unicode code points, such as surrogates. A new parameter 'nonstrict' makes them accept all code points up to (2^31)-1, as in the original UTF-8 specification.
* New macros for arithmetic/bitwise operations in 'luaV_execute'Roberto Ierusalimschy2018-11-051-1/+1
| | | | | | | The repetitive code of the arithmetic and bitwise operators in the main iterpreter loop was moved to appropriate macros. (As a detail, the function 'luaV_div' was renamed 'luaV_idiv', as it does an "integer division" (floor division).
* Corrections in the implementation of '%' for floats.Roberto Ierusalimschy2018-08-281-5/+1
| | | | | | | | | The multiplication (m*b) used to test whether 'm' is non-zero and 'm' and 'b' have different signs can underflow for very small numbers, giving a wrong result. The use of explicit comparisons solves this problem. This commit also adds several new tests for '%' (both for floats and for integers) to exercise more corner cases, such as very large and very small values.
* Removed extra information from RCS keyword stringsRoberto Ierusalimschy2018-08-231-1/+1
| | | | | Version numbers and dates (mostly wrong) from RCS keyword strings removed from all source files; only the file name are kept.
* no more 'luaO_nilobject' to avoid comparison of global variable addressesRoberto Ierusalimschy2018-06-011-5/+1
| | | | (now uses static variables)
* 'luaO_pushvfstring' does not need to reallocate stackRoberto Ierusalimschy2018-04-251-10/+12
| | | | (less error cases in the API)
* removed compatibility code with older versionsRoberto Ierusalimschy2018-02-271-3/+1
|
* janitor work on castsRoberto Ierusalimschy2018-01-281-8/+8
|
* typos in commentsRoberto Ierusalimschy2017-12-301-3/+3
|
* detail (typo in comments)Roberto Ierusalimschy2017-11-231-2/+2
|
* detail ('signal' -> 'sign' in comments)Roberto Ierusalimschy2017-11-161-4/+4
|
* new function 'luaV_flttointeger' to convert floats to integers (withoutRoberto Ierusalimschy2017-11-081-2/+2
| | | | | string coercions) + string operands to bitwise operations handled by string metamethods
* raw operation should not convert strings to numbersRoberto Ierusalimschy2017-10-101-2/+2
|
* coercion string->number in arithmetic operations moved to stringRoberto Ierusalimschy2017-07-071-2/+2
| | | | library
* new type 'StackValue' for stack elementsRoberto Ierusalimschy2017-06-291-19/+26
| | | | (we may want to put extra info there in the future)
* assert removed in 'luaO_arith'Roberto Ierusalimschy2017-05-241-2/+1
| | | | (nobody calls it with L==NULL)
* new macro 'lua_pointer2str' to encapsulate use of 'l_sprintf' insideRoberto Ierusalimschy2017-04-191-2/+3
| | | | the kernel
* detail (removing spaces at end of lines)Roberto Ierusalimschy2016-12-221-2/+2
|
* small corrections for C++ complianceRoberto Ierusalimschy2016-06-271-2/+2
|
* do not convert decimal constants with overflow to integers.Roberto Ierusalimschy2016-05-201-2/+8
| | | | (Therefore, they will be converted as floats)