aboutsummaryrefslogtreecommitdiff
path: root/lapi.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* '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.
* | Simplification in handling of GC debtRoberto Ierusalimschy2022-12-061-13/+17
| | | | | | | | | | Each incremental step has always the same size (stepsize), and the debt for next step also is always the same.
* | Simpler control for major collectionsRoberto Ierusalimschy2022-11-291-2/+2
| |
* | Removed GC checks from function callsRoberto Ierusalimschy2022-11-241-2/+3
| | | | | | | | | | Function calls do not create new objects. (It may use memory with stack reallocation, but now that is irrelevant to the GC.)
* | 'l_mem' renamed to 'l_obj' to count objectsRoberto Ierusalimschy2022-11-231-3/+3
| |
* | First version of GC counting objects for controlRoberto Ierusalimschy2022-11-231-4/+5
|/ | | | Still needs to review generational mode.
* Stack indices changed to union'sRoberto Ierusalimschy2022-10-291-116/+119
| | | | | That will allow to change pointers to offsets while reallocating the stack.
* Bug: 'lua_settop' may use an invalid pointer to stackRoberto Ierusalimschy2022-05-251-3/+2
|
* 'lua_checkstack' doesn't need to check stack overflowRoberto Ierusalimschy2022-05-231-7/+2
| | | | | | '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-12-211-1/+1
| | | | correction in macro for hard tests + type in comment
* Bug: GC is not reentrantRoberto Ierusalimschy2021-12-131-8/+9
| | | | As the GC is not reentrant, finalizers should not be able to invoke it.
* Using 'inline' in some functionsRoberto Ierusalimschy2021-09-151-5/+7
| | | | | According to ISO C, "making a function an inline function suggests that calls to the function be as fast as possible." (Not available in C89.)
* 'index2value' more robustRoberto Ierusalimschy2021-05-241-5/+13
| | | | | 'index2value' accepts pseudo-indices also when called from a Lua function, through a hook.
* lua_settop/lua_pop closes to-be-closed variablesRoberto Ierusalimschy2021-03-091-7/+8
| | | | | | The existence of 'lua_closeslot' is no reason for lua_pop not to close to-be-closed variables too. It is too error-prone for lua_pop not to close tbc variables being popped from the stack.
* New implementation for to-be-closed variablesRoberto Ierusalimschy2021-02-091-6/+3
| | | | | | | | To-be-closed variables are linked in their own list, embedded into the stack elements. (Due to alignment, this information does not change the size of the stack elements in most architectures.) This new list does not produce garbage and avoids memory errors when creating tbc variables.
* New macro 'completestate'Roberto Ierusalimschy2021-02-051-1/+1
|
* Fixed some bugs around stack reallocationRoberto Ierusalimschy2021-02-051-0/+1
| | | | Long time without using HARDSTACKTESTS...
* Janitorial workRoberto Ierusalimschy2021-01-251-1/+2
| | | | Comments, code details, identation.
* Allow yields inside '__close' metamethodsRoberto Ierusalimschy2021-01-131-2/+2
| | | | | | | Initial implementation to allow yields inside '__close' metamethods. This current version still does not allow a '__close' metamethod to yield when called due to an error. '__close' metamethods from C functions also are not allowed to yield.
* New API function 'lua_closeslot'Roberto Ierusalimschy2021-01-111-1/+18
| | | | | | Closing a to-be-closed variable with 'lua_settop' is too restrictive, as it erases all slots above the variable. Moreover, it adds side effects to 'lua_settop', which should be a fairly basic function.
* Cleaner handling of errors in '__close' metamethodsRoberto Ierusalimschy2020-12-281-1/+1
| | | | | Instead of protecting each individual metamethod call, protect the entire call to 'luaF_close'.