2
1

lua-bug6-gc_performance.patch 414 B

1234567891011121314
  1. --- lua-5.1.4.orig/src/llex.c 2007/12/28 15:32:23 2.63.1.3
  2. +++ lua-5.1.4/src/llex.c 2010/02/23 12:36:59
  3. @@ -118,8 +118,10 @@
  4. lua_State *L = ls->L;
  5. TString *ts = luaS_newlstr(L, str, l);
  6. TValue *o = luaH_setstr(L, ls->fs->h, ts); /* entry for `str' */
  7. - if (ttisnil(o))
  8. + if (ttisnil(o)) {
  9. setbvalue(o, 1); /* make sure `str' will not be collected */
  10. + luaC_checkGC(L);
  11. + }
  12. return ts;
  13. }