[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: pairs(t, skey) and ipairs(t, skey)
- From: Paul K <paulclinger@...>
- Date: Wed, 2 Oct 2013 11:58:18 -0700
Hi Javier,
> that puts some attention on one part we seldom discuss: how and when
> does the Lua table implementation maintains the array part? I seem to
> remember Roberto (or Luiz?) writing that "the array part grows and
> shrinks to keep it more than half empty", or some similar specification.
I only see (looking at 5.2 code) luaH_resizearray called when
OP_SETLIST is handled; it may mean that all other assignments will
either have to fit the allocated array or will go to the hash part.
The keys will be rehashed and possibly re-allocated to the array part
when "rehash" is done; this happens when there is no free place in the
hash for a new key.
Paul.
- References:
- Re: pairs(t, skey) and ipairs(t, skey), Dirk Laurie
- Re: pairs(t, skey) and ipairs(t, skey), Paul K
- Re: pairs(t, skey) and ipairs(t, skey), Luiz Henrique de Figueiredo
- Re: pairs(t, skey) and ipairs(t, skey), Tim Hill
- Re: pairs(t, skey) and ipairs(t, skey), Luiz Henrique de Figueiredo
- Re: pairs(t, skey) and ipairs(t, skey), steve donovan
- Re: pairs(t, skey) and ipairs(t, skey), Paul K
- Re: pairs(t, skey) and ipairs(t, skey), Javier Guerra Giraldez