summaryrefslogtreecommitdiff
path: root/ext/objspace
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-09-07 08:28:57 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-09-07 08:28:57 (GMT)
commit164a93c8b745ae86f11a2a13524ab3cdc5367706 (patch)
tree0f684bd8be0f8af0132b8d09760c5f3e0de6e7ef /ext/objspace
parent68df2b0881585ef926e4be2342adc013f8a1a174 (diff)
object_tracing.c: register TracePoint objects
* ext/objspace/object_tracing.c (trace_object_allocations_start): to prevent TracePoint objects from GC, register them in the VM, since they are unique per VM. http://ci.rvm.jp/results/trunk-test@ruby-sky3/1291901 * ext/objspace/object_tracing.c (trace_object_allocations_stop): reuse TracePoint objects. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64655 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/objspace')
-rw-r--r--ext/objspace/object_tracing.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/objspace/object_tracing.c b/ext/objspace/object_tracing.c
index 0c268b1..dc9d6d4 100644
--- a/ext/objspace/object_tracing.c
+++ b/ext/objspace/object_tracing.c
@@ -185,7 +185,9 @@ trace_object_allocations_start(VALUE self)
else {
if (arg->newobj_trace == 0) {
arg->newobj_trace = rb_tracepoint_new(0, RUBY_INTERNAL_EVENT_NEWOBJ, newobj_i, arg);
+ rb_gc_register_mark_object(arg->newobj_trace);
arg->freeobj_trace = rb_tracepoint_new(0, RUBY_INTERNAL_EVENT_FREEOBJ, freeobj_i, arg);
+ rb_gc_register_mark_object(arg->freeobj_trace);
}
rb_tracepoint_enable(arg->newobj_trace);
rb_tracepoint_enable(arg->freeobj_trace);
@@ -215,8 +217,6 @@ trace_object_allocations_stop(VALUE self)
if (arg->running == 0) {
rb_tracepoint_disable(arg->newobj_trace);
rb_tracepoint_disable(arg->freeobj_trace);
- arg->newobj_trace = 0;
- arg->freeobj_trace = 0;
}
return Qnil;