Skip to content

Commit

Permalink
lj_trace.c: Reset hotcount table after flush
Browse files Browse the repository at this point in the history
This is intended so that new traces taken after a flush will be
selected in the same heuristic order as the original traces (i.e.
don't pick a strange order due to residual hotcount state.)
  • Loading branch information
lukego committed Sep 8, 2017
1 parent 01dc844 commit a720595
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/lj_trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,8 @@ int lj_trace_flushall(lua_State *L)
J->freetrace = 0;
/* Clear penalty cache. */
memset(J->penalty, 0, sizeof(J->penalty));
/* Reset hotcounts. */
lj_dispatch_init_hotcount(J2G(J));
/* Free the whole machine code and invalidate all exit stub groups. */
lj_mcode_free(J);
memset(J->exitstubgroup, 0, sizeof(J->exitstubgroup));
Expand Down

0 comments on commit a720595

Please sign in to comment.