<feed xmlns='http://www.w3.org/2005/Atom'>
<title>lua/ltable.h, branch v5.5.1</title>
<subtitle>A mirror of https://github.com/lua/lua
</subtitle>
<id>https://git.lua4.win/lua/atom?h=v5.5.1</id>
<link rel='self' href='https://git.lua4.win/lua/atom?h=v5.5.1'/>
<link rel='alternate' type='text/html' href='https://git.lua4.win/lua/'/>
<updated>2025-07-18T19:18:30+00:00</updated>
<entry>
<title>Randomness added to table length computation</title>
<updated>2025-07-18T19:18:30+00:00</updated>
<author>
<name>Roberto Ierusalimschy</name>
<email>roberto@inf.puc-rio.br</email>
</author>
<published>2025-07-18T19:18:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/lua/commit/?id=303f4155593721dfd57dadc6e56122e465ce9efb'/>
<id>urn:sha1:303f4155593721dfd57dadc6e56122e465ce9efb</id>
<content type='text'>
A bad actor could fill only a few entries in a table (power of twos in
decreasing order, see tests) and produce a small table with a huge
length. If your program builds a table with external data and iterates
over its length, this behavior could be an issue.
</content>
</entry>
<entry>
<title>Scanner and parser use different tables for constants</title>
<updated>2024-12-17T14:23:22+00:00</updated>
<author>
<name>Roberto Ierusalimschy</name>
<email>roberto@inf.puc-rio.br</email>
</author>
<published>2024-12-17T14:23:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/lua/commit/?id=1c40ff9faafed620aa0458b397bcbfbe19e0f663'/>
<id>urn:sha1:1c40ff9faafed620aa0458b397bcbfbe19e0f663</id>
<content type='text'>
Moreover, each function being parsed has its own table.

The code is cleaner when each table is used for one specific purpose:
The scanner uses its table to anchor and unify strings, mapping strings
to themselves; the parser uses it to reuse constants in the code,
mapping constants to their indices in the constant table. A different
table for each task avoids false collisions.
</content>
</entry>
<entry>
<title>'luaH_fastseti' uses 'checknoTM'</title>
<updated>2024-12-11T18:32:43+00:00</updated>
<author>
<name>Roberto Ierusalimschy</name>
<email>roberto@inf.puc-rio.br</email>
</author>
<published>2024-12-11T18:32:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/lua/commit/?id=412e9a4d952d47631feddfa4ec25a520ec75b103'/>
<id>urn:sha1:412e9a4d952d47631feddfa4ec25a520ec75b103</id>
<content type='text'>
The extra check in checknoTM (versus only checking whether there is a
metatable) is cheap, and it is not that uncommon for a table to have a
metatable without a __newindex metafield.
</content>
</entry>
<entry>
<title>New way to keep hints for table length</title>
<updated>2024-11-29T20:26:20+00:00</updated>
<author>
<name>Roberto Ierusalimschy</name>
<email>roberto@inf.puc-rio.br</email>
</author>
<published>2024-11-29T20:26:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/lua/commit/?id=002beeebe79065e03dd9f531bee367e8459e3f64'/>
<id>urn:sha1:002beeebe79065e03dd9f531bee367e8459e3f64</id>
<content type='text'>
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.
</content>
</entry>
<entry>
<title>'objsize' returns 'l_mem'</title>
<updated>2024-11-15T15:04:53+00:00</updated>
<author>
<name>Roberto Ierusalimschy</name>
<email>roberto@inf.puc-rio.br</email>
</author>
<published>2024-11-15T15:04:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/lua/commit/?id=a4762b6ffe74f5878882ef238d37bfa92d90e418'/>
<id>urn:sha1:a4762b6ffe74f5878882ef238d37bfa92d90e418</id>
<content type='text'>
Sums of size_t may not fit in a size_t.
</content>
</entry>
<entry>
<title>'objsize' broke in smaller pieces</title>
<updated>2024-09-30T17:01:42+00:00</updated>
<author>
<name>Roberto Ierusalimschy</name>
<email>roberto@inf.puc-rio.br</email>
</author>
<published>2024-09-30T17:01:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/lua/commit/?id=3d54b42d59bcc1b31a369f3497ac22745d63cae6'/>
<id>urn:sha1:3d54b42d59bcc1b31a369f3497ac22745d63cae6</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Added gcc option '-Wconversion'</title>
<updated>2024-07-27T16:32:59+00:00</updated>
<author>
<name>Roberto Ierusalimschy</name>
<email>roberto@inf.puc-rio.br</email>
</author>
<published>2024-07-27T16:32:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/lua/commit/?id=0acd55898d0aaae8dbc14c8a1bc1e3bdffc8701b'/>
<id>urn:sha1:0acd55898d0aaae8dbc14c8a1bc1e3bdffc8701b</id>
<content type='text'>
No warnings for standard numerical types. Still pending alternative
numerical types.
</content>
</entry>
<entry>
<title>Encoding of table indices (hres) must use C indices</title>
<updated>2024-06-10T15:09:35+00:00</updated>
<author>
<name>Roberto Ierusalimschy</name>
<email>roberto@inf.puc-rio.br</email>
</author>
<published>2024-06-10T15:09:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/lua/commit/?id=94b503d95ef00f1e38b58b024ef45bf8973a8746'/>
<id>urn:sha1:94b503d95ef00f1e38b58b024ef45bf8973a8746</id>
<content type='text'>
As the encoding of array indices is (~index), 0 is encoded as -1 and
INT_MAX is encoded as INT_MIN.
</content>
</entry>
<entry>
<title>Yet another representation for arrays</title>
<updated>2024-04-05T18:35:11+00:00</updated>
<author>
<name>Roberto Ierusalimschy</name>
<email>roberto@inf.puc-rio.br</email>
</author>
<published>2024-04-05T18:35:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/lua/commit/?id=5edacafcfa36a1fa86a7b5316bacf8c6a2c47227'/>
<id>urn:sha1:5edacafcfa36a1fa86a7b5316bacf8c6a2c47227</id>
<content type='text'>
This "linear" representation (see ltable.h for details) has worse
locality than cells, but the simpler access code seems to compensate
that.
</content>
</entry>
<entry>
<title>Some 'unsigned int' changed to 'unsigned'</title>
<updated>2024-03-22T17:06:11+00:00</updated>
<author>
<name>Roberto Ierusalimschy</name>
<email>roberto@inf.puc-rio.br</email>
</author>
<published>2024-03-22T17:06:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/lua/commit/?id=9fa63a62682c1353eeabd4575152941fa6f3e70f'/>
<id>urn:sha1:9fa63a62682c1353eeabd4575152941fa6f3e70f</id>
<content type='text'>
'unsigned int' is too long sometimes. (We already write 'long' instead
of 'long int'...)
</content>
</entry>
</feed>
