Skip to content

Commit 4a469c7

Browse files
committed
Merge remote-tracking branch 'eileencodes/minor-refactoring' into mmtk
2 parents 8973e65 + 2118467 commit 4a469c7

File tree

2 files changed

+10
-13
lines changed

2 files changed

+10
-13
lines changed

gc.c

+8-11
Original file line numberDiff line numberDiff line change
@@ -2666,10 +2666,6 @@ gc_event_hook_body(rb_execution_context_t *ec, rb_objspace_t *objspace, const rb
26662666

26672667
#define gc_event_hook(objspace, event, data) gc_event_hook_prep(objspace, event, data, (void)0)
26682668

2669-
#if USE_MMTK
2670-
2671-
#endif
2672-
26732669
static inline VALUE
26742670
newobj_init(VALUE klass, VALUE flags, int wb_protected, rb_objspace_t *objspace, VALUE obj)
26752671
{
@@ -3341,7 +3337,8 @@ cvar_table_free_i(VALUE value, void *ctx)
33413337
#define ZOMBIE_OBJ_KEPT_FLAGS (FL_SEEN_OBJ_ID | FL_FINALIZE)
33423338

33433339
#if USE_MMTK
3344-
static inline void rb_mmtk_push_final_job(struct MMTk_FinalJob *job)
3340+
static inline void
3341+
rb_mmtk_push_final_job(struct MMTk_FinalJob *job)
33453342
{
33463343
rb_objspace_t *objspace = &rb_objspace;
33473344

@@ -7524,15 +7521,15 @@ gc_mark_children(rb_objspace_t *objspace, VALUE obj)
75247521
if (any->as.match.str) {
75257522
gc_mark(objspace, any->as.match.str);
75267523
}
7527-
#if USE_MMTK
7524+
#if USE_MMTK
75287525
if (rb_mmtk_enabled_p()) {
75297526
// If GC is triggered when the mutator is resizing the following buffers, we retain
75307527
// them because their contents need to be copied to the new buffers after GC.
75317528
rb_mmtk_scan_offsetted_strbuf_field((char**)&RMATCH_EXT(any)->char_offset, false);
75327529
rb_mmtk_scan_offsetted_strbuf_field((char**)&RMATCH_EXT(any)->regs.beg, false);
75337530
rb_mmtk_scan_offsetted_strbuf_field((char**)&RMATCH_EXT(any)->regs.end, false);
75347531
}
7535-
#endif
7532+
#endif
75367533
break;
75377534

75387535
case T_RATIONAL:
@@ -10321,7 +10318,7 @@ gc_sort_heap_by_compare_func(rb_objspace_t *objspace, gc_compact_compare_func co
1032110318

1032210319
#if USE_MMTK
1032310320
static void
10324-
gc_ref_update_string(rb_objspace_t * objspace, VALUE str)
10321+
rb_mmtk_gc_ref_update_string(rb_objspace_t * objspace, VALUE str)
1032510322
{
1032610323
if (STR_EMBED_P(str)) {
1032710324
// Embedded strings don't point into any buffer.
@@ -10851,7 +10848,7 @@ gc_update_object_references(rb_objspace_t *objspace, VALUE obj)
1085110848
{
1085210849
#if USE_MMTK
1085310850
if (rb_mmtk_enabled_p()) {
10854-
gc_ref_update_string(objspace, obj);
10851+
rb_mmtk_gc_ref_update_string(objspace, obj);
1085510852
break;
1085610853
}
1085710854
#endif
@@ -10926,15 +10923,15 @@ gc_update_object_references(rb_objspace_t *objspace, VALUE obj)
1092610923
UPDATE_IF_MOVED(objspace, any->as.match.str);
1092710924
}
1092810925

10929-
#if USE_MMTK
10926+
#if USE_MMTK
1093010927
if (rb_mmtk_enabled_p()) {
1093110928
// If GC is triggered when the mutator is resizing the following buffers, we retain
1093210929
// them because their contents need to be copied to the new buffers after GC.
1093310930
rb_mmtk_scan_offsetted_strbuf_field((char**)&RMATCH_EXT(any)->char_offset, true);
1093410931
rb_mmtk_scan_offsetted_strbuf_field((char**)&RMATCH_EXT(any)->regs.beg, true);
1093510932
rb_mmtk_scan_offsetted_strbuf_field((char**)&RMATCH_EXT(any)->regs.end, true);
1093610933
}
10937-
#endif
10934+
#endif
1093810935

1093910936
break;
1094010937

imemo.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ cc_table_mark_i(ID id, VALUE ccs_ptr, void *data)
241241

242242
#if USE_MMTK
243243
static enum rb_id_table_iterator_result
244-
cc_table_mark_i_no_id(VALUE ccs_ptr, void *data_ptr)
244+
rb_mmtk_cc_table_mark_i_no_id(VALUE ccs_ptr, void *data_ptr)
245245
{
246246
return cc_table_mark_i(0, ccs_ptr, data_ptr);
247247
}
@@ -257,7 +257,7 @@ rb_cc_table_mark(VALUE klass)
257257
// Note: rb_id_table_foreach will look up the ID from keys by accessing
258258
// arrays in the heap during key2id, but the id is only used for
259259
// assertion which fails with an evacuating GC (such as Immix) anyway.
260-
rb_id_table_foreach_values(cc_tbl, cc_table_mark_i_no_id, (void *)klass);
260+
rb_id_table_foreach_values(cc_tbl, rb_mmtk_cc_table_mark_i_no_id, (void *)klass);
261261
} else {
262262
#endif
263263
rb_id_table_foreach(cc_tbl, cc_table_mark_i, (void *)klass);

0 commit comments

Comments
 (0)