FFI: Rehash finalizer table after GC cycle, if needed.

This commit is contained in:
Mike Pall
2013-10-14 19:31:24 +02:00
parent 3cdeb54a24
commit 5d25645a21
4 changed files with 18 additions and 1 deletions

View File

@@ -351,6 +351,13 @@ static void rehashtab(lua_State *L, GCtab *t, cTValue *ek)
resizetab(L, t, asize, hsize2hbits(total));
}
#if LJ_HASFFI
void lj_tab_rehash(lua_State *L, GCtab *t)
{
rehashtab(L, t, niltv(L));
}
#endif
void lj_tab_reasize(lua_State *L, GCtab *t, uint32_t nasize)
{
resizetab(L, t, nasize+1, t->hmask > 0 ? lj_fls(t->hmask)+1 : 0);