diff options
author | Takashi Kokubun <takashikkbn@gmail.com> | 2020-02-28 23:20:44 -0800 |
---|---|---|
committer | Takashi Kokubun <takashikkbn@gmail.com> | 2020-02-28 23:20:44 -0800 |
commit | a8dcab723316997d9e01c89d6df969edce75bdca (patch) | |
tree | bac08f3547e43feb1852f62f704bb7f2a5ae08f2 /mjit.c | |
parent | 5e897227ff3d37a36be96bb2c082370d437058ea (diff) |
Avoid infinite loop on --jit-wait
Diffstat (limited to 'mjit.c')
-rw-r--r-- | mjit.c | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -376,7 +376,14 @@ unload_units(void) remove_from_list(worst, &active_units); free_unit(worst); } - verbose(1, "Too many JIT code -- %d units unloaded", units_num - active_units.length); + + if (units_num == active_units.length && mjit_opts.wait) { + mjit_opts.max_cache_size++; // avoid infinite loop on `rb_mjit_wait_call`. Note that --jit-wait is just for testing. + verbose(1, "No units can be unloaded -- incremented max-cache-size to %d for --jit-wait", mjit_opts.max_cache_size); + } + else { + verbose(1, "Too many JIT code -- %d units unloaded", units_num - active_units.length); + } } static void |