mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Prevent mjit length counters from being 0
It seems that `debug_counter_show_results_at_exit` could be called earlier than `mjit_finish` sometimes. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67380 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
b03c11a337
commit
5ee256da68
2 changed files with 10 additions and 6 deletions
6
mjit.c
6
mjit.c
|
@ -781,12 +781,6 @@ mjit_finish(bool close_handle_p)
|
|||
if (!mjit_enabled)
|
||||
return;
|
||||
|
||||
#if USE_DEBUG_COUNTER
|
||||
rb_debug_counter_add(RB_DEBUG_COUNTER_mjit_length_unit_queue, unit_queue.length, 1);
|
||||
rb_debug_counter_add(RB_DEBUG_COUNTER_mjit_length_active_units, active_units.length, 1);
|
||||
rb_debug_counter_add(RB_DEBUG_COUNTER_mjit_length_compact_units, compact_units.length, 1);
|
||||
#endif
|
||||
|
||||
/* Wait for pch finish */
|
||||
verbose(2, "Stopping worker thread");
|
||||
CRITICAL_SECTION_START(3, "in mjit_finish to wakeup from pch");
|
||||
|
|
|
@ -327,6 +327,10 @@ mjit_warning(const char *format, ...)
|
|||
static void
|
||||
add_to_list(struct rb_mjit_unit *unit, struct rb_mjit_unit_list *list)
|
||||
{
|
||||
RB_DEBUG_COUNTER_INC_IF(mjit_length_unit_queue, list == &unit_queue);
|
||||
RB_DEBUG_COUNTER_INC_IF(mjit_length_active_units, list == &active_units);
|
||||
RB_DEBUG_COUNTER_INC_IF(mjit_length_compact_units, list == &compact_units);
|
||||
|
||||
list_add_tail(&list->head, &unit->unode);
|
||||
list->length++;
|
||||
}
|
||||
|
@ -334,6 +338,12 @@ add_to_list(struct rb_mjit_unit *unit, struct rb_mjit_unit_list *list)
|
|||
static void
|
||||
remove_from_list(struct rb_mjit_unit *unit, struct rb_mjit_unit_list *list)
|
||||
{
|
||||
#if USE_DEBUG_COUNTER
|
||||
rb_debug_counter_add(RB_DEBUG_COUNTER_mjit_length_unit_queue, -1, list == &unit_queue);
|
||||
rb_debug_counter_add(RB_DEBUG_COUNTER_mjit_length_active_units, -1, list == &active_units);
|
||||
rb_debug_counter_add(RB_DEBUG_COUNTER_mjit_length_compact_units, -1, list == &compact_units);
|
||||
#endif
|
||||
|
||||
list_del(&unit->unode);
|
||||
list->length--;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue