[前][次][番号順一覧][スレッド一覧]

ruby-changes:58605

From: Aaron <ko1@a...>
Date: Thu, 7 Nov 2019 09:32:10 +0900 (JST)
Subject: [ruby-changes:58605] d0d743ad45 (master): Remove duplicate code

https://git.ruby-lang.org/ruby.git/commit/?id=d0d743ad45

From d0d743ad4558a572769f0f11ece11fda068652b3 Mon Sep 17 00:00:00 2001
From: Aaron Patterson <tenderlove@r...>
Date: Wed, 6 Nov 2019 16:29:09 -0800
Subject: Remove duplicate code

These functions are the same, so remove one.

Co-authored-by: John Hawthorn <john@h...>

diff --git a/gc.c b/gc.c
index 5a4f72d..cee8f6c 100644
--- a/gc.c
+++ b/gc.c
@@ -7995,12 +7995,6 @@ gc_ref_update_hash(rb_objspace_t * objspace, VALUE v) https://github.com/ruby/ruby/blob/trunk/gc.c#L7995
     rb_hash_stlike_foreach_with_replace(v, hash_foreach_replace, hash_replace_ref, (st_data_t)objspace);
 }
 
-void rb_update_st_references(struct st_table *ht)
-{
-    rb_objspace_t *objspace = &rb_objspace;
-    gc_update_table_refs(objspace, ht);
-}
-
 static void
 gc_ref_update_method_entry(rb_objspace_t *objspace, rb_method_entry_t *me)
 {
diff --git a/include/ruby/intern.h b/include/ruby/intern.h
index b9471a7..e53b4e6 100644
--- a/include/ruby/intern.h
+++ b/include/ruby/intern.h
@@ -532,10 +532,9 @@ PUREFUNC(int rb_during_gc(void)); https://github.com/ruby/ruby/blob/trunk/include/ruby/intern.h#L532
 void rb_gc_mark_locations(const VALUE*, const VALUE*);
 void rb_mark_tbl(struct st_table*);
 void rb_mark_tbl_no_pin(struct st_table*);
-void rb_gc_update_tbl_refs(st_table *ptr);
 void rb_mark_set(struct st_table*);
 void rb_mark_hash(struct st_table*);
-void rb_update_st_references(struct st_table *ht);
+void rb_gc_update_tbl_refs(st_table *ptr);
 void rb_gc_mark_maybe(VALUE);
 void rb_gc_mark(VALUE);
 void rb_gc_mark_movable(VALUE);
diff --git a/vm.c b/vm.c
index 9f02489..ed02a71 100644
--- a/vm.c
+++ b/vm.c
@@ -2220,7 +2220,7 @@ rb_vm_update_references(void *ptr) https://github.com/ruby/ruby/blob/trunk/vm.c#L2220
 {
     if (ptr) {
         rb_vm_t *vm = ptr;
-        rb_update_st_references(vm->frozen_strings);
+        rb_gc_update_tbl_refs(vm->frozen_strings);
     }
 }
 
-- 
cgit v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]