Skip to content

Commit

Permalink
Introduce gc_mark_table macro
Browse files Browse the repository at this point in the history
  • Loading branch information
S-H-GAMELINKS authored and tenderlove committed May 18, 2023
1 parent 2df5a69 commit 0c3f699
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions variable.c
Expand Up @@ -501,12 +501,13 @@ mark_global_entry(VALUE v, void *ignored)
return ID_TABLE_CONTINUE;
}

#define gc_mark_table(task) \
if (rb_global_tbl) { rb_id_table_foreach_values(rb_global_tbl, task##_global_entry, 0); }

void
rb_gc_mark_global_tbl(void)
{
if (rb_global_tbl) {
rb_id_table_foreach_values(rb_global_tbl, mark_global_entry, 0);
}
gc_mark_table(mark);
}

static enum rb_id_table_iterator_result
Expand All @@ -522,9 +523,7 @@ update_global_entry(VALUE v, void *ignored)
void
rb_gc_update_global_tbl(void)
{
if (rb_global_tbl) {
rb_id_table_foreach_values(rb_global_tbl, update_global_entry, 0);
}
gc_mark_table(update);
}

static ID
Expand Down

0 comments on commit 0c3f699

Please sign in to comment.