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.
This commit is contained in:
Roberto Ierusalimschy
2022-11-01 15:42:08 -03:00
parent ee645472eb
commit 8047b2d03e
7 changed files with 84 additions and 24 deletions

View File

@@ -999,9 +999,8 @@ static int table_query (lua_State *L) {
if (i == -1) {
lua_pushinteger(L, asize);
lua_pushinteger(L, allocsizenode(t));
lua_pushinteger(L, isdummy(t) ? 0 : t->lastfree - t->node);
lua_pushinteger(L, t->alimit);
return 4;
return 3;
}
else if ((unsigned int)i < asize) {
lua_pushinteger(L, i);