aboutsummaryrefslogtreecommitdiff
path: root/ltable.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Corrected support for 16-bit systemsRoberto Ierusalimschy2023-03-091-0/+2
| | | | | We still need access to a 16-bit system to correctly test these changes.
* Removed test function 'luaH_isdummy'Roberto Ierusalimschy2022-10-211-2/+0
| | | | It was not being used anywhere.
* DetailsRoberto Ierusalimschy2022-10-191-2/+2
| | | | Some cast operations rewritten to use respective macros.
* Main 'mainposition' replaced by 'mainpositionTV'Roberto Ierusalimschy2021-11-251-19/+16
| | | | | Handle values in table keys as the special cases they are, and not the other way around.
* Avoid taking the address of a 'TValue' fieldRoberto Ierusalimschy2021-10-111-9/+9
| | | | That structure can be packed in the future.
* New hash function for integer keysRoberto Ierusalimschy2021-03-291-2/+14
| | | | | | | When integer keys do not form a sequence, it is better to use all their bits to compute their hashes. (The previous implementation was quite bad for integer keys with common lower bits, and disastrous for integer keys changing only in their upper 32 bits.)
* DetailsRoberto Ierusalimschy2021-03-121-21/+40
| | | | Comments and order of hashing macros in 'ltable.c'.
* Broadening the use of branch hintsRoberto Ierusalimschy2021-02-241-4/+4
| | | | | | 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).
* Do not insert nil values into tablesRoberto Ierusalimschy2020-12-291-0/+2
|
* Changes in the API of 'luaH_set' and related functionsRoberto Ierusalimschy2020-12-041-15/+27
| | | | | Functions to set values in a table (luaH_set, luaH_newkey, etc.) receive the new value, instead of returning a slot where to put the value.
* CommentsRoberto Ierusalimschy2020-10-221-10/+17
|
* Fixed bug of keys removed from tables vs 'next'Roberto Ierusalimschy2020-10-141-10/+17
| | | | | | 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-1/+1
| | | | | | | | 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.
* Clearer distinction between types and tagsRoberto Ierusalimschy2020-01-311-23/+23
| | | | | LUA_T* represents only types; tags (types + Variants) are represented by LUA_V* constants.
* Changed internal representation of booleansRoberto Ierusalimschy2020-01-061-5/+5
| | | | | | | 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.)
* Using an enumeration for float->integer coercion modesRoberto Ierusalimschy2019-12-051-2/+2
|
* Details (mostly comments)Roberto Ierusalimschy2019-10-221-0/+3
|
* Janitorial workRoberto Ierusalimschy2019-10-011-20/+24
| | | | | | | - Several details in 'lcode.c' - A few more tests for code generation - Bug in assert in 'lcode.c' ("=" x "==") - Comments in 'lopcodes.h' and 'ltable.c'
* A few changes in tests about number of bits in integersRoberto Ierusalimschy2019-05-131-2/+2
| | | | | | - 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.
* Small optimizations in range checksRoberto Ierusalimschy2019-03-271-5/+5
| | | | | | | | Checks of the form '1 <= x && x <= M' were rewritten in the form '(unsigned)x - 1 < (unsigned)M', which is usually more efficient. (Other similar checks have similar translations.) Although some compilers do these optimizations, that does not happen for all compilers or all cases.
* 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.
* warning (comparison between signed and unsigned integers)Roberto Ierusalimschy2018-06-151-2/+3
|
* field 'sizearray' in struct 'Table' changed to 'alimit', which canRoberto Ierusalimschy2018-06-151-36/+161
| | | | be used as a hint for '#t'
* no more 'luaH_emptyobject' and comparisons of addresses of global variablesRoberto Ierusalimschy2018-06-011-9/+10
| | | | | (instead, use a different kind of nil to signal the fake entry returned when a key is not found in a table)
* new macros 'likely'/'unlikely' with hints for jump predictionsRoberto Ierusalimschy2018-05-301-5/+6
| | | | (used only in errors for now)
* detail ('l_castU2S' should only be used over lua_Unsigned values)Roberto Ierusalimschy2018-05-291-2/+2
|
* better names for macros for tags and types.Roberto Ierusalimschy2018-02-261-6/+6
| | | | | rttype -> rawtt; ttyperaw -> withvariant; ttype -> ttypetag; tnov -> ttype
* first version of empty entries in tablesRoberto Ierusalimschy2018-02-231-30/+33
| | | | (so that, in the future, tables can contain regular nil entries)
* small reorganization of 'luaV_flttointeger'/'luaV_tointeger'Roberto Ierusalimschy2018-02-211-4/+5
|
* more generic way to handle 'gclist'Roberto Ierusalimschy2018-02-191-2/+2
|
* janitor work on castsRoberto Ierusalimschy2018-01-281-5/+5
|
* another try with table resize.Roberto Ierusalimschy2017-12-291-41/+55
| | | | | (Old version was leaving some elements unanchored while allocating new memory)
* more freedom in handling memory-allocation errors (not all allocationsRoberto Ierusalimschy2017-12-081-32/+63
| | | | | automatically raise an error), which allows fixing a bug when resizing a table.
* using explicit tests for allocation overflow whenever possibleRoberto Ierusalimschy2017-12-071-9/+29
|
* detail (typo in comments)Roberto Ierusalimschy2017-11-231-2/+2
|
* new function 'luaV_flttointeger' to convert floats to integers (withoutRoberto Ierusalimschy2017-11-081-3/+3
| | | | | string coercions) + string operands to bitwise operations handled by string metamethods
* new type 'StackValue' for stack elementsRoberto Ierusalimschy2017-06-291-6/+6
| | | | (we may want to put extra info there in the future)
* no more 'DEADKEY'. Table traversals do not need to consider dead keys;Roberto Ierusalimschy2017-06-121-37/+27
| | | | | | if the key is dead, it cannot be given to 'next'. Instead, we now use a 'table' tag without the collectable bit, which makes it a unique tag good enough to reserve space.
* in hash nodes, keys are stored in separate pieces to avoid wastingRoberto Ierusalimschy2017-06-091-46/+85
| | | | space with alignments
* BUG: in 'computesizes', 'twotoi' overflows when a sequence hasRoberto Ierusalimschy2017-05-191-3/+6
| | | | more than 2^30 elements.
* better implementation for 'hash_search', without using 'size_t'Roberto Ierusalimschy2017-05-191-28/+36
| | | | (simpler to implement and to explain)
* reimplementation of 'luaH_getn', trying to handle numeric limitsRoberto Ierusalimschy2017-05-161-33/+44
| | | | properly.
* detail ('1' -> '1u' in unsigned operation)Roberto Ierusalimschy2017-05-091-2/+2
|
* using 'lastfree == NULL' to signal that table is using the dummyRoberto Ierusalimschy2016-11-071-23/+23
| | | | node for its hash part + new macro 'allocsizenode'
* details (typos in comments)Roberto Ierusalimschy2015-11-191-2/+2
|
* no need for a special case to get long strings (not that common)Roberto Ierusalimschy2015-11-031-22/+16
|
* added comment and assert about dead keysRoberto Ierusalimschy2015-11-031-2/+3
|
* bug: despite its name, 'luaH_getstr' did not work for strings inRoberto Ierusalimschy2015-11-031-16/+35
| | | | general, but only for short strings
* avoid possibility of subtle arith. overflowRoberto Ierusalimschy2015-07-041-2/+2
|
* detailRoberto Ierusalimschy2015-07-011-2/+2
|