diff options
author | normal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-03-17 19:59:56 +0000 |
---|---|---|
committer | normal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-03-17 19:59:56 +0000 |
commit | a5a777dc0aa1a198db307a1f9bb3668e4d3c76d5 (patch) | |
tree | d5cced02e3e1a3e9a89ff0862f83ee5bdb35f658 /compile.c | |
parent | eae1520a6d1ea4c312a1aa3905af6a17daefdab7 (diff) | |
download | ruby-a5a777dc0aa1a198db307a1f9bb3668e4d3c76d5.tar.gz |
remove branches in dmark and dfree GC callbacks
dmark and dfree callbacks are never called in gc.c for NULL
DATA_PTR values, not even for zombie objects.
* compile.c (ibf_loader_mark): remove branch for pointer validity
* compile.c (ibf_loader_free): ditto
* cont.c (cont_free): ditto
* cont.c (fiber_free): ditto
* dir.c (dir_free): ditto
* ext/stringio/stringio.c (strio_mark): ditto
* proc.c (binding_free): ditto
* thread_sync.c (mutex_free): ditto
* vm.c (thread_free): ditto
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58006 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'compile.c')
-rw-r--r-- | compile.c | 18 |
1 files changed, 7 insertions, 11 deletions
@@ -8631,22 +8631,18 @@ ibf_load_setup(struct ibf_load *load, VALUE loader_obj, VALUE str) static void ibf_loader_mark(void *ptr) { - if (ptr) { - struct ibf_load *load = (struct ibf_load *)ptr; - rb_gc_mark(load->str); - rb_gc_mark(load->iseq_list); - rb_gc_mark(load->obj_list); - } + struct ibf_load *load = (struct ibf_load *)ptr; + rb_gc_mark(load->str); + rb_gc_mark(load->iseq_list); + rb_gc_mark(load->obj_list); } static void ibf_loader_free(void *ptr) { - if (ptr) { - struct ibf_load *load = (struct ibf_load *)ptr; - ruby_xfree(load->id_list); - ruby_xfree(load); - } + struct ibf_load *load = (struct ibf_load *)ptr; + ruby_xfree(load->id_list); + ruby_xfree(load); } static size_t |