aboutsummaryrefslogtreecommitdiff
path: root/luaconf.h (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Ease slightly making Lua with C89Roberto Ierusalimschy2024-11-151-0/+5
|
* Floats formatted with "correct" precisionRoberto Ierusalimschy2024-08-021-5/+11
| | | | | | Conversion float->string ensures that, for any float f, tonumber(tostring(f)) == f, but still avoiding noise like 1.1 converting to "1.1000000000000001".
* Maximum stack size may not fit in unsigned shortRoberto Ierusalimschy2024-07-161-4/+4
| | | | | | 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.
* lua.c loads 'readline' dynamicallyRoberto Ierusalimschy2024-07-041-0/+11
| | | | | | | (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.
* Cleaning of llimits.hRoberto Ierusalimschy2024-06-201-4/+1
| | | | | | 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.
* DetailsRoberto Ierusalimschy2024-05-081-1/+1
| | | | | Corrections in comments and manual. Added note in the manual about local variables in the REPL.
* Option '-l' discards version sufix from file nameRoberto Ierusalimschy2023-05-151-0/+9
| | | | | | Like 'require', the command-line option '-l' discards an optional version suffix (everything after an hyphen) from a file name when creating the module name.
* New macro LUA_USE_IOSRoberto Ierusalimschy2023-02-021-0/+6
| | | | | Do not try to detect automatically whether system is iOS; it is simpler and more reliable to let the programmer inform that.
* Changed the growth rate of string buffersRoberto Ierusalimschy2022-09-061-2/+3
| | | | | | | | The growth rate of string buffers was reduced from 2 to 1.5 (3/2). As string buffers start larger (256~1024 bytes), they don't need to grow that fast. Moreover, a lower rate allows multiplicative growth up to larger sizes (3/2 of the maximum). (After that, the growth becomes linear, which is mostly useless.)
* 'lua_checkstack' doesn't need to check stack overflowRoberto Ierusalimschy2022-05-231-1/+1
| | | | | | 'luaD_growstack' already checks that. This commit also fixes an internal bug in 'luaD_growstack': a large 'n' could cause an arithmetic overflow when computing 'needed'.
* DetailsRoberto Ierusalimschy2021-05-241-4/+0
| | | | | - Removed unused (and trivial) definition LUA_UNSIGNEDBITS - Alignment structure in pack/unpack moved to a narrower scope
* Added option LUA_NOBUILTINv5.4.3Roberto Ierusalimschy2021-03-121-2/+4
| | | | | This option allows external code to avoid the use of gcc builtin macro '__builtin_expect' in the Lua API.
* Uses of "likely" in macros active to all usersRoberto Ierusalimschy2021-03-091-6/+12
| | | | | | | The use of 'l_likely' in auxlib macros 'luaL_argcheck' and 'luaL_argexpected' should not be restricted to Lua's own code. For that, 'l_likely' was renamed to 'luai_likely' to be exported to external code.
* Broadening the use of branch hintsRoberto Ierusalimschy2021-02-241-0/+20
| | | | | | More uses of macros 'likely'/'unlikely' (renamed to 'l_likely'/'l_unlikely'), both in range (extended to the libraries) and in scope (extended to hooks, stack growth).
* Forbid changing numerical types through compiler optionsRoberto Ierusalimschy2021-02-051-41/+42
| | | | | | | | 'luaconf.h' always defines options LUA_32BITS, LUA_C89_NUMBERS, LUA_INT_TYPE, and LUA_FLOAT_TYPE (using 0/1 for the first two), to avoid they being set through compiler options. (It is too easy to forget these options when compiling other software that interoperates with Lua.)
* Revision of stackless implementationRoberto Ierusalimschy2020-10-121-15/+0
| | | | | | - more organized handling of 'nCcalls' - comments - deprecation of 'setcstacklimit'
* Back to a stackless implementationRoberto Ierusalimschy2020-10-121-4/+4
| | | | | | | | | | | | | A "with stack" implementation gains too little in performance to be worth all the noise from C-stack overflows. This commit is almost a sketch, to test performance. There are several pending stuff: - review control of C-stack overflow and error messages; - what to do with setcstacklimit; - review comments; - review unroll of Lua calls.
* 'l_mathlim' renamed to 'l_floatatt'Roberto Ierusalimschy2019-12-051-4/+4
| | | | That macro is applied to float attributes, not to limits.
* Details (typos in comments)Roberto Ierusalimschy2019-07-051-1/+1
|
* Small changes around C-stack limitRoberto Ierusalimschy2019-06-261-1/+1
| | | | | | | | | - Better documentation in 'testes/cstack.lua' about using 'debug.setCstacklimit' to find a good limit. - Constant LUAI_MAXCSTACK gets added CSTACKERR (extra stack for error handling), so that it is compatible with the argument to 'debug.setCstacklimit'.
* DetailsRoberto Ierusalimschy2019-05-281-5/+9
| | | | | | | - 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'
* Define LUA_MAXUNSIGNED as a preprocessor constantRoberto Ierusalimschy2019-05-141-1/+8
| | | | | The previous definition of LUA_MAXUNSIGNED used a typecast, making it unsuitable for constant expressions in the preprocessor.
* A few changes in tests about number of bits in integersRoberto Ierusalimschy2019-05-131-2/+1
| | | | | | - The preprocessor must work with at least 'long', and therefore must do shifts of up to 31 bits correctly. - Whenever possible, use unsigned types in shifts.
* Some improvements in 'luaconf.h'Roberto Ierusalimschy2019-05-131-31/+57
| | | | | Added '#if !defined' in some definitions to allow external definitions; more comments; other small changes.
* A few more improvements in 'luaO_pushvfstring'Roberto Ierusalimschy2019-05-031-3/+10
| | | | | | | | - '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
* Revamp of 'lua_pushfstring' / 'luaO_pushvfstring'Roberto Ierusalimschy2019-04-241-7/+0
| | | | | | | | | 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.)
* Avoid using large buffers in 'string.format'Roberto Ierusalimschy2019-04-121-8/+1
| | | | | | | The result of "string.format("%.99f", -1e308) is 410 characters long, but all other formats have much smaller limits (at most 99 plus a fex extras). This commit avoids 'string.format' asking for a buffer ~400 chars large when ~100 will do.
* LUAI_MAXCCALLS renamed LUAI_MAXCSTACKRoberto Ierusalimschy2019-03-251-0/+15
| | | | | | | The limit LUAI_MAXCCALLS was renamed LUAI_MAXCSTACK, which better represents its meaning. Moreover, its definition was moved to 'luaconf.h', given its importance now that Lua does not use a "stackless" implementation.
* Changes in the control of C-stack overflowRoberto Ierusalimschy2018-12-271-2/+2
| | | | | | | | | | * unification of the 'nny' and 'nCcalls' counters; * external C functions ('lua_CFunction') count more "slots" in the C stack (to allow for their possible use of buffers) * added a new test script specific for C-stack overflows. (Most of those tests were already present, but concentrating them in a single script easies the task of checking whether 'LUAI_MAXCCALLS' is adequate in a system.)
* Visibility of non-API functions changed to "internal"Roberto Ierusalimschy2018-11-131-1/+1
| | | | | | | The visibility for functions marked as LUAI_FUNC was changed from "hidden" to "internal". These functions cannot be called from outside the Lua kernel, and "internal" visibility offers more chances for optimizations.
* Deprecated the emulation of '__le' using '__lt'Roberto Ierusalimschy2018-08-241-1/+7
| | | | | | | | | | | As hinted in the manual for Lua 5.3, the emulation of the metamethod for '__le' using '__le' has been deprecated. It is slow, complicates the logic, and it is easy to avoid this emulation by defining a proper '__le' function. Moreover, often this emulation was used wrongly, with a programmer assuming that an order is total when it is not (e.g., NaN in floating-point numbers).
* 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.
* opening functions must be exported!v5.4-w2Roberto Ierusalimschy2018-06-191-5/+3
|
* change in 'LUAI_DDEC' to allow variables to be static in 'onelua'Roberto Ierusalimschy2018-06-181-6/+10
| | | | + change in 'LUAMOD_API' as opening functions do not need to be global
* detail (removed unused definition for 'LUA_QS')Roberto Ierusalimschy2018-06-151-10/+2
|
* definition for LUA_UNSIGNEDBITS (number of bits in a LUA_UNSIGNED)Roberto Ierusalimschy2018-04-021-1/+4
|
* added definition for LUA_MAXUNSIGNEDRoberto Ierusalimschy2018-03-091-1/+4
|
* 'LUA_USE_READLINE' moved to the make fileRoberto Ierusalimschy2018-03-021-3/+1
|
* removed compatibility code with older versionsRoberto Ierusalimschy2018-02-271-75/+5
|
* detail (comment)Roberto Ierusalimschy2018-02-201-7/+8
|
* typos in commentsRoberto Ierusalimschy2017-12-301-3/+3
|
* detail (comment)Roberto Ierusalimschy2017-12-071-1/+2
|
* type 'L_Umaxalign' replaced by macro 'LUAI_MAXALIGN', which is also addedRoberto Ierusalimschy2017-04-241-1/+7
| | | | to the auxlib buffer
* new macro 'lua_pointer2str' to encapsulate use of 'l_sprintf' insideRoberto Ierusalimschy2017-04-191-1/+8
| | | | the kernel
* detail (removing spaces at end of lines)Roberto Ierusalimschy2016-12-221-2/+2
|
* Using LUAI_UAC* types more consistently on vararg callsRoberto Ierusalimschy2016-12-201-6/+10
|
* wrong test in '#if' for floating-point typeRoberto Ierusalimschy2016-08-221-3/+3
|
* Handling of LUA_PATH/LUA_CPATH moved from package library to standRoberto Ierusalimschy2016-07-181-1/+13
| | | | | alone interpreter (so that 'lua.c' concentrates all handling of environment variables)
* detail (macro should "use" all its arguments)Roberto Ierusalimschy2016-05-011-2/+2
|
* generic definitions for float types moved to before variable definitionsRoberto Ierusalimschy2015-10-211-20/+26
| | | | | (so that specific cases can redefine these generic definitions if needed)