aboutsummaryrefslogtreecommitdiff
path: root/testes/nextvar.lua
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2022-11-01 15:42:08 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2022-11-01 15:42:08 -0300
commit8047b2d03eaaeee44871a11f8d3a3135f2639b1a (patch)
tree2b2d246e2c63ba0accd7c3463a0d331669abe1ef /testes/nextvar.lua
parentee645472ebe153e2c6669c84a632297a8110bdb6 (diff)
downloadlua-8047b2d03eaaeee44871a11f8d3a3135f2639b1a.tar.gz
lua-8047b2d03eaaeee44871a11f8d3a3135f2639b1a.tar.bz2
lua-8047b2d03eaaeee44871a11f8d3a3135f2639b1a.zip
Tables have a 'lastfree' information only when needed
Only tables with some minimum number of entries in their hash part have a 'lastfree' field, kept in a header before the node vector.
Diffstat (limited to 'testes/nextvar.lua')
-rw-r--r--testes/nextvar.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/testes/nextvar.lua b/testes/nextvar.lua
index 0874e5bb..80b3d05c 100644
--- a/testes/nextvar.lua
+++ b/testes/nextvar.lua
@@ -210,9 +210,9 @@ assert(T.querytab(a) == 64) -- array part has 64 elements
210a[32] = true; a[48] = true; -- binary search will find these ones 210a[32] = true; a[48] = true; -- binary search will find these ones
211a[51] = true -- binary search will miss this one 211a[51] = true -- binary search will miss this one
212assert(#a == 48) -- this will set the limit 212assert(#a == 48) -- this will set the limit
213assert(select(4, T.querytab(a)) == 48) -- this is the limit now 213assert(select(3, T.querytab(a)) == 48) -- this is the limit now
214a[50] = true -- this will set a new limit 214a[50] = true -- this will set a new limit
215assert(select(4, T.querytab(a)) == 50) -- this is the limit now 215assert(select(3, T.querytab(a)) == 50) -- this is the limit now
216-- but the size is larger (and still inside the array part) 216-- but the size is larger (and still inside the array part)
217assert(#a == 51) 217assert(#a == 51)
218 218