Skip to content

Commit

Permalink
do not charge gas for garbage collection on V4
Browse files Browse the repository at this point in the history
  • Loading branch information
kroggen committed Aug 2, 2023
1 parent 552328c commit 58772ed
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/lj_gc.c
Original file line number Diff line number Diff line change
Expand Up @@ -688,7 +688,9 @@ int LJ_FASTCALL lj_gc_step(lua_State *L)
if (g->gc.total > g->gc.threshold)
g->gc.debt += g->gc.total - g->gc.threshold;
do {
lua_gasuse(L, GAS_SLOW);
if (g->hardfork_version < 4) {
lua_gasuse(L, GAS_SLOW);
}
lim -= (GCSize)gc_onestep(L);
if (g->gc.state == GCSpause) {
g->gc.threshold = (g->gc.estimate/100) * g->gc.pause;
Expand Down

0 comments on commit 58772ed

Please sign in to comment.