aboutsummaryrefslogtreecommitdiff
path: root/lobject.h (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Refactoring of 'luaH_newkey'Roberto Ierusalimschy2024-12-051-3/+2
| | | | | Function broke in two and some checks moved to the caller. (We may want to call it without the checks.)
* New way to keep hints for table lengthRoberto Ierusalimschy2024-11-291-14/+2
| | | | | | | | | | Instead of using 'alimit' for keeping the size of the array and at the same time being a hint for '#t', a table now keeps these two values separate. The Table structure has a field 'asize' with the size of the array, while the length hint is kept in the array itself. That way, tables with no array part waste no space with that field. Moreover, the space for the hint may have zero cost for small arrays, if the array of tags plus the hint still fits in a single word.
* New function 'lua_numbertostrbuff'Roberto Ierusalimschy2024-10-231-0/+1
| | | | | It converts a Lua number to a string in a buffer, without creating a new Lua string.
* GC back to controling pace counting bytesRoberto Ierusalimschy2024-09-191-1/+1
| | | | Memory is the resource we want to save. Still to be reviewed again.
* Added gcc option '-Wconversion'Roberto Ierusalimschy2024-07-271-10/+10
| | | | | No warnings for standard numerical types. Still pending alternative numerical types.
* Cleaning of llimits.hRoberto Ierusalimschy2024-06-201-0/+3
| | | | | | 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.
* Yet another representation for arraysRoberto Ierusalimschy2024-04-051-4/+1
| | | | | | This "linear" representation (see ltable.h for details) has worse locality than cells, but the simpler access code seems to compensate that.
* Fixed dangling 'StkId' in 'luaV_finishget'Roberto Ierusalimschy2024-03-291-0/+2
| | | | Bug introduced in 05932567.
* 'luaH_get' functions return tag of the resultRoberto Ierusalimschy2024-03-211-18/+8
| | | | | | | 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-0/+19
| | | | | | 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.)
* Several tweaks in the garbage collectorRoberto Ierusalimschy2023-12-271-2/+2
| | | | | | - 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-0/+3
| | | | | This encoding brings more precision and a larger range for these parameters.
* Simpler coding for new representation for arraysRoberto Ierusalimschy2023-11-241-1/+1
| | | | | With the tags comming first in a cell, we can define the whole cell as a C type and let C do part of the address computations.
* External stringsRoberto Ierusalimschy2023-11-091-0/+8
| | | | Strings can use external buffers to store their contents.
* Towards external stringsRoberto Ierusalimschy2023-11-081-10/+13
| | | | Long strings have a pointer to string contents.
* Merge branch 'newarray' into nextversionRoberto Ierusalimschy2023-11-071-1/+6
|\
| * Merge branch 'master' into newarrayRoberto Ierusalimschy2023-11-031-10/+8
| |\
| * | Full implementation of new representation for arraysRoberto Ierusalimschy2023-11-031-1/+3
| | |
| * | Full abstraction for representation of array valuesRoberto Ierusalimschy2023-10-301-1/+4
| | |
* | | Added suport for Fixed BuffersRoberto Ierusalimschy2023-09-051-0/+1
| | | | | | | | | | | | | | | A fixed buffer keeps a binary chunk "forever", so that the program does not need to copy some of its parts when loading it.
* | | New macro 'getlstr'Roberto Ierusalimschy2023-08-301-2/+9
| | | | | | | | | | | | Accesses content and length of a 'TString'.
* | | Field 'Proto.is_vararg' uses only one bitRoberto Ierusalimschy2023-08-301-1/+8
| | | | | | | | | | | | So that the other bits can be used for other purposes.
* | | Merge branch 'master' into nextversionRoberto Ierusalimschy2023-08-231-10/+8
|\ \ \ | | |/ | |/|
| * | More disciplined use of 'getstr' and 'tsslen'Roberto Ierusalimschy2023-08-171-10/+8
| |/ | | | | | | | | We may want to add other string variants in the future; this change documents better where the code may need to handle those variants.
* | Merge branch 'master' into nextversionRoberto Ierusalimschy2022-12-011-1/+0
|\|
| * Removed unused field 'UpVal.tbc'Roberto Ierusalimschy2022-11-081-1/+0
| |
* | Tables have a 'lastfree' information only when neededRoberto Ierusalimschy2022-11-011-1/+0
|/ | | | | Only tables with some minimum number of entries in their hash part have a 'lastfree' field, kept in a header before the node vector.
* Stack reallocation done with a single reallocRoberto Ierusalimschy2022-10-311-0/+6
| | | | | | | To avoid the need of both the old and the new stack addresses valid at the same time, to correct the pointers to the stack, these pointers are changed to offsets before the reallocation and then changed back to pointers after the reallocation.
* Stack indices changed to union'sRoberto Ierusalimschy2022-10-291-1/+9
| | | | | That will allow to change pointers to offsets while reallocating the stack.
* More checks and documentation for uses of EXTRA_STACKRoberto Ierusalimschy2022-05-261-0/+2
|
* Avoid taking the address of a 'TValue' fieldRoberto Ierusalimschy2021-10-111-1/+1
| | | | That structure can be packed in the future.
* DetailsRoberto Ierusalimschy2021-03-291-1/+1
| | | | Comments and small improvements in the manual.
* New implementation for 'tbclist'Roberto Ierusalimschy2021-03-101-2/+3
| | | | | | | | | | | | | | - Fixes a bug, by removing dummy nodes together with the node itself. (The previous implementation could leave dummy nodes in frames which otherwise had no tbc variables, and therefore would not close variables; that could leave 'tbclist' pointing higher than 'top', which could dangle if the stack shrank.) - Computes MAXDELTA based on the type of delta, to ease changing its type if needed. - Instead of 'isdummy', uses 'delta==0' to signal dummy nodes. (Dummy nodes always have MAXDELTA for their real delta.)
* New implementation for to-be-closed variablesRoberto Ierusalimschy2021-02-091-1/+9
| | | | | | | | 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.
* Cleaner definition for macro 'ttisclosure'Roberto Ierusalimschy2020-12-161-1/+2
|
* Fixed bug of keys removed from tables vs 'next'Roberto Ierusalimschy2020-10-141-8/+10
| | | | | | Fixed the bug that a key removed from a table might not be found again by 'next'. (This is needed to allow keys to be removed during a traversal.) This bug was introduced in commit 73ec04fc.
* Free bit 7 of GC 'marked' fieldRoberto Ierusalimschy2020-08-071-3/+3
| | | | | | | | Tables were using this bit to indicate their array sizes were real ('isrealasize'), but this bit can be useful for tests. Instead, they can use bit 7 of their 'flag' field for that purpose. (There are only six fast-access metamethods.) This 'flag' field only exists in tables, so this use does not affect other types.
* Detail (in asserts)Roberto Ierusalimschy2020-08-031-1/+2
| | | | Macro 'checkconsistency' replaced by the similar 'checkliveness".
* Cleaner definition for 'TString'Roberto Ierusalimschy2020-05-191-4/+3
| | | | | Use a variable-sized array to store string contents at the end of a structure 'TString', instead of raw memory.
* Several details about 5.4.0 rc1Roberto Ierusalimschy2020-04-231-2/+1
| | | | | Corrected several small details: added 'const', adjusts in tabs x spaces, removed unused #includes and #defines, misspellings, etc.
* Tag values don't need to be different from type valuesRoberto Ierusalimschy2020-01-311-18/+19
| | | | Variants can use zero for first variant.
* Clearer distinction between types and tagsRoberto Ierusalimschy2020-01-311-60/+76
| | | | | LUA_T* represents only types; tags (types + Variants) are represented by LUA_V* constants.
* New macro 'makevariant' to codify variant tagsRoberto Ierusalimschy2020-01-061-11/+14
|
* Changed internal representation of booleansRoberto Ierusalimschy2020-01-061-7/+10
| | | | | | | Instead of an explicit value (field 'b'), true and false use different tag variants. This avoids reading an extra field and results in more direct code. (Most code that uses booleans needs to distinguish between true and false anyway.)
* Changed definition of macro 'l_isfalse'Roberto Ierusalimschy2019-10-221-1/+1
| | | | | | The old definition did one test for nil, but three tests for the all too common booleans (and two tests for other values); this definition does two tests for all values.
* Details (mostly comments)Roberto Ierusalimschy2019-10-221-8/+23
|
* Tag LUA_TUPVALTBC replaced by a flagRoberto Ierusalimschy2019-07-191-3/+1
| | | | | It is simpler to signal a to-be-closed upvalue with a boolean flag, instead of using a different tag.
* DetailsRoberto Ierusalimschy2019-07-181-5/+5
| | | | | | | - Macro 'checkliveness' (for debug) always uses 'L', to avoid warnings. - Some old 'while' changed to 'for' in 'testes/gc.lua'. - In 'testes/libs/makefile', do not make files depend on 'ltests.h', which may not even exist.
* OP_NEWTABLE keeps exact size of arraysRoberto Ierusalimschy2019-07-121-2/+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.)
* First implementation of constant propagationRoberto Ierusalimschy2019-07-121-1/+1
| | | | | Local constant variables initialized with compile-time constants are optimized away from the code.