Skip to content

Commit

Permalink
mark source_regex while in use
Browse files Browse the repository at this point in the history
  • Loading branch information
tmm1 committed Sep 18, 2012
1 parent 36e3f70 commit 899894d
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions ext/rblineprof.c
Original file line number Diff line number Diff line change
Expand Up @@ -202,9 +202,19 @@ lineprof(VALUE self, VALUE filename)
return ret;
}

static void
rblineprof_gc_mark()
{
if (rblineprof.enabled)
rb_gc_mark_maybe(rblineprof.source_regex);
}

void
Init_rblineprof()
{
gc_hook = Data_Wrap_Struct(rb_cObject, rblineprof_gc_mark, NULL, NULL);
rb_global_variable(&gc_hook);

rblineprof.files = st_init_strtable();
rb_define_global_function("lineprof", lineprof, 1);
}

0 comments on commit 899894d

Please sign in to comment.