diff options
author | normal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-07-15 08:29:22 +0000 |
---|---|---|
committer | normal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-07-15 08:29:22 +0000 |
commit | 72b9e5275ed28551de0307e9ddaa62db845e89be (patch) | |
tree | d39f8594878553632d951423d22bc2542d4ffd06 /vm_trace.c | |
parent | 4a465ed38f839ef97f442e6b0bc00ac3ea456394 (diff) | |
download | ruby-72b9e5275ed28551de0307e9ddaa62db845e89be.tar.gz |
remove redundant NULL check in mark functions
gc.c (gc_mark_children)only calls mark_func if the T_DATA ptr is
non-NULL, so avoid redundantly checking for that in each
mark function.
* iseq.c (iseq_mark): remove check for data pointer
* proc.c (binding_mark): ditto
* vm.c (rb_thread_mark): ditto
* vm_trace.c (tp_mark): ditto
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51252 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_trace.c')
-rw-r--r-- | vm_trace.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/vm_trace.c b/vm_trace.c index cec0deecb0..b46437038c 100644 --- a/vm_trace.c +++ b/vm_trace.c @@ -653,11 +653,9 @@ typedef struct rb_tp_struct { static void tp_mark(void *ptr) { - if (ptr) { - rb_tp_t *tp = (rb_tp_t *)ptr; - rb_gc_mark(tp->proc); - if (tp->target_th) rb_gc_mark(tp->target_th->self); - } + rb_tp_t *tp = ptr; + rb_gc_mark(tp->proc); + if (tp->target_th) rb_gc_mark(tp->target_th->self); } static size_t |