FFI: Turn FFI finalizer table into a proper GC root.

Reported by Sergey Bronnikov. #1168
This commit is contained in:
Mike Pall
2024-04-19 01:33:19 +02:00
parent 7110b93567
commit f5affaa6c4
7 changed files with 39 additions and 44 deletions

View File

@@ -196,6 +196,9 @@ static TValue *cpluaopen(lua_State *L, lua_CFunction dummy, void *ud)
lj_lex_init(L);
fixstring(lj_err_str(L, LJ_ERR_ERRMEM)); /* Preallocate memory error msg. */
g->gc.threshold = 4*g->gc.total;
#if LJ_HASFFI
lj_ctype_initfin(L);
#endif
lj_trace_initstate(g);
lj_err_verify();
return NULL;