aboutsummaryrefslogtreecommitdiff
path: root/lapi.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Main thread is a regular field of global_StateRoberto Ierusalimschy2025-01-311-1/+1
| | | | | They were already allocated as a single block, so there is no need for the global_State to point to its main thread.
* New type 'TStatus' for thread status/error codesRoberto Ierusalimschy2025-01-301-5/+5
|
* CallInfo bit CIST_CLSRET broken in twoRoberto Ierusalimschy2025-01-281-3/+3
| | | | | | | | | Since commit f407b3c4a, it was being used for two distinct (and incompatible) meanings: A: Function has TBC variables (now bit CIST_TBC) B: Interpreter is closing TBC variables (original bit CIST_CLSRET) B implies A, but A does not imply B.
* Renaming two new functionsRoberto Ierusalimschy2025-01-271-2/+2
| | | | | 'lua_numbertostrbuff' -> 'lua_numbertocstring' 'lua_pushextlstring' -> 'lua_pushexternalstring'
* Parameters for 'lua_createtable' back to intRoberto Ierusalimschy2025-01-211-2/+2
| | | | Tables don't accept sizes larger than int.
* Small change in macro 'isvalid'Roberto Ierusalimschy2025-01-161-3/+1
| | | | | The "faster way" to check whether a value is not 'nilvalue' is not faster. (Both forms entail one memory access.)
* Improvements in the manualRoberto Ierusalimschy2025-01-101-2/+1
| | | | Plus details
* More integration of 'nresults' into 'callstatus'Roberto Ierusalimschy2024-11-151-3/+0
|
* New function 'lua_numbertostrbuff'Roberto Ierusalimschy2024-10-231-0/+12
| | | | | 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-0/+2
| | | | | | 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.
* Removed 'if' left from commit ddfa1fbccfeRoberto Ierusalimschy2024-09-201-1/+0
|
* USHRT_MAX changed to SHRT_MAXRoberto Ierusalimschy2024-09-191-1/+1
| | | | USHRT_MAX does not fit in an 'int' in 16-bit systems.
* GC back to controling pace counting bytesRoberto Ierusalimschy2024-09-191-16/+3
| | | | Memory is the resource we want to save. Still to be reviewed again.
* Parameter for lua_gc/LUA_GCSTEP changed to 'size_t'Roberto Ierusalimschy2024-09-101-1/+1
| | | | | 'size_t' is the common type for measuring memory. 'int' can be too small for steps.
* Rename of fields in global state that control GCRoberto Ierusalimschy2024-09-061-2/+2
| | | | | All fields in the global state that control the pace of the garbage collector prefixed with 'GC'.
* Added gcc option '-Wconversion'Roberto Ierusalimschy2024-07-271-13/+13
| | | | | No warnings for standard numerical types. Still pending alternative numerical types.
* 'nresults' moved into 'callstatus'Roberto Ierusalimschy2024-07-211-3/+1
| | | | That gives us more free bits in 'callstatus', for future use.
* Using CIST_CLSRET instead of trick with 'nresults'Roberto Ierusalimschy2024-07-191-5/+3
| | | | | The callstatus flag CIST_CLSRET is used in all tests for the presence of variables to be closed in C functions.
* Explicit limit for number of results in a callRoberto Ierusalimschy2024-07-181-2/+7
| | | | | | The parameter 'nresults' in 'lua_call' and similar functions has a limit of 250. It already had an undocumented (and unchecked) limit of SHRT_MAX, but it is seldom larger than 2.
* Length of external strings must fit in Lua integerRoberto Ierusalimschy2024-06-241-0/+1
| | | | (As the length of any string in Lua.)
* 'luaH_get' functions return tag of the resultRoberto Ierusalimschy2024-03-211-34/+35
| | | | | | | 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-181-31/+30
| | | | | | 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.)
* API asserts for illegal pops of to-be-closed variablesRoberto Ierusalimschy2024-03-111-25/+27
|
* Fixed warnings from different compilersRoberto Ierusalimschy2024-02-151-1/+1
|
* Better handling of size limit when resizing a tableRoberto Ierusalimschy2024-02-071-1/+1
| | | | | | | | 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-291-2/+1
|
* New mechanism to query GC parametersRoberto Ierusalimschy2024-01-161-2/+3
|
* Optimizations for 'lua_rawgeti' and 'lua_rawseti'Roberto Ierusalimschy2024-01-121-8/+11
| | | | | | '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-101-0/+14
|
* Several tweaks in the garbage collectorRoberto Ierusalimschy2023-12-271-6/+12
| | | | | | - 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-221-14/+0
| | | | | | 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-221-7/+17
| | | | | | 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-201-13/+6
| | | | | This encoding brings more precision and a larger range for these parameters.
* Cleaner protocol between 'lua_dump' and writer functionRoberto Ierusalimschy2023-12-141-25/+7
| | | | | 'lua_dump' signals to the writer function the end of a dump, so that is has more freedom when using the stack.
* First criteria for shifts minor<->majorRoberto Ierusalimschy2023-12-071-11/+14
|
* Major collections done incrementallyRoberto Ierusalimschy2023-12-061-1/+1
| | | | | Major collections do not need to "stop the world". Still pending: criteria for shifts minor-major, shifts generational-incremental.
* Removed parameter in 'collectgarbage("step")'Roberto Ierusalimschy2023-12-011-16/+2
| | | | A call to 'collectgarbage("step")' always performs one GC basic step.
* Removed deprecated options in 'lua_gc'Roberto Ierusalimschy2023-11-301-15/+3
| | | | Options 'setpause' and 'setstepmul' were deprecated in Lua 5.4.
* External stringsRoberto Ierusalimschy2023-11-091-0/+14
| | | | Strings can use external buffers to store their contents.
* Merge branch 'newarray' into nextversionRoberto Ierusalimschy2023-11-071-58/+52
|\
| * Merge branch 'master' into newarrayRoberto Ierusalimschy2023-11-031-2/+2
| |\
| * | Full abstraction for representation of array valuesRoberto Ierusalimschy2023-10-301-17/+14
| | |
| * | Some cleaning in the new table APIRoberto Ierusalimschy2023-05-161-36/+34
| | |
| * | New table API for 'set' functionsRoberto Ierusalimschy2023-05-161-14/+17
| | |
| * | Towards a new implementation of arraysRoberto Ierusalimschy2023-05-151-18/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The array part of a table wastes too much space, due to padding. To avoid that, we need to store values in the array as something different from a TValue. Therefore, the API for table access should not assume that any value in a table lives in a *TValue. This commit is the first step to remove that assumption: functions luaH_get*, instead of returning a *TValue where the value lives, receive a *TValue where to put the value being accessed. (We still have to change the luaH_set* functions.)
* | | Merge branch 'master' into nextversionRoberto Ierusalimschy2023-08-231-2/+2
|\ \ \ | | |/ | |/|
| * | More disciplined use of 'getstr' and 'tsslen'Roberto Ierusalimschy2023-08-171-2/+2
| |/ | | | | | | | | We may want to add other string variants in the future; this change documents better where the code may need to handle those variants.
* | Dump/undump reuse stringsRoberto Ierusalimschy2022-12-151-4/+25
| | | | | | | | | | A repeated string in a dump is represented as an index to its first occurence, instead of another copy of the string.
* | Changed signal of GC debtRoberto Ierusalimschy2022-12-131-4/+4
| | | | | | | | Positive debts seems more natural then negative ones.
* | Revamp of GC parametersRoberto Ierusalimschy2022-12-131-15/+15
| | | | | | | | | | More uniformity when handling GC parameters + avoid divisions by 100 when applying them.