aboutsummaryrefslogtreecommitdiffstats
path: root/ext
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-09-07 08:28:57 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-09-07 08:28:57 +0000
commit4d808ef2ad183dbdd5cec1f9953b938165c24b81 (patch)
tree0f684bd8be0f8af0132b8d09760c5f3e0de6e7ef /ext
parenta98ee82278e912f15c4fe4f27c80bbdceab35cfc (diff)
downloadruby-4d808ef2ad183dbdd5cec1f9953b938165c24b81.tar.gz
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')
-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 0c268b114a..dc9d6d4bb2 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;