ext/stackprof/stackprof.c in stackprof-0.2.14 vs ext/stackprof/stackprof.c in stackprof-0.2.15
- old
+ new
@@ -282,10 +282,12 @@
rb_hash_aset(results, sym_samples, SIZET2NUM(_stackprof.overall_samples));
rb_hash_aset(results, sym_gc_samples, SIZET2NUM(_stackprof.during_gc));
rb_hash_aset(results, sym_missed_samples, SIZET2NUM(_stackprof.overall_signals - _stackprof.overall_samples));
rb_hash_aset(results, sym_metadata, _stackprof.metadata);
+ _stackprof.metadata = Qnil;
+
frames = rb_hash_new();
rb_hash_aset(results, sym_frames, frames);
st_foreach(_stackprof.frames, frame_i, (st_data_t)frames);
st_free_table(_stackprof.frames);
@@ -651,9 +653,12 @@
}
static void
stackprof_gc_mark(void *data)
{
+ if (RTEST(_stackprof.metadata))
+ rb_gc_mark(_stackprof.metadata);
+
if (RTEST(_stackprof.out))
rb_gc_mark(_stackprof.out);
if (_stackprof.frames)
st_foreach(_stackprof.frames, frame_mark_i, 0);