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 | a0908cb41356f4384a3e9a199c14490a452080ef (patch) | |
tree | d39f8594878553632d951423d22bc2542d4ffd06 /iseq.c | |
parent | 28c42b4c25c48f65cd559018678a5cf34d387c24 (diff) |
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 'iseq.c')
-rw-r--r-- | iseq.c | 31 |
1 files changed, 15 insertions, 16 deletions
@@ -102,27 +102,26 @@ iseq_free(void *ptr) static void iseq_mark(void *ptr) { - RUBY_MARK_ENTER("iseq"); + rb_iseq_t *iseq = ptr; - if (ptr) { - rb_iseq_t *iseq = ptr; + RUBY_MARK_ENTER("iseq"); - RUBY_GC_INFO("%s @ %s\n", RSTRING_PTR(iseq->location.label), RSTRING_PTR(iseq->location.path)); + RUBY_GC_INFO("%s @ %s\n", RSTRING_PTR(iseq->location.label), RSTRING_PTR(iseq->location.path)); - RUBY_MARK_UNLESS_NULL(iseq->mark_ary); - RUBY_MARK_UNLESS_NULL(iseq->location.label); - RUBY_MARK_UNLESS_NULL(iseq->location.base_label); - RUBY_MARK_UNLESS_NULL(iseq->location.path); - RUBY_MARK_UNLESS_NULL(iseq->location.absolute_path); - RUBY_MARK_UNLESS_NULL(iseq->coverage); + RUBY_MARK_UNLESS_NULL(iseq->mark_ary); + RUBY_MARK_UNLESS_NULL(iseq->location.label); + RUBY_MARK_UNLESS_NULL(iseq->location.base_label); + RUBY_MARK_UNLESS_NULL(iseq->location.path); + RUBY_MARK_UNLESS_NULL(iseq->location.absolute_path); + RUBY_MARK_UNLESS_NULL(iseq->coverage); - if (iseq->compile_data != 0) { - struct iseq_compile_data *const compile_data = iseq->compile_data; - RUBY_MARK_UNLESS_NULL(compile_data->mark_ary); - RUBY_MARK_UNLESS_NULL(compile_data->err_info); - RUBY_MARK_UNLESS_NULL(compile_data->catch_table_ary); - } + if (iseq->compile_data != 0) { + struct iseq_compile_data *const compile_data = iseq->compile_data; + RUBY_MARK_UNLESS_NULL(compile_data->mark_ary); + RUBY_MARK_UNLESS_NULL(compile_data->err_info); + RUBY_MARK_UNLESS_NULL(compile_data->catch_table_ary); } + RUBY_MARK_LEAVE("iseq"); } |