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

ruby-changes:61645

From: Aaron <ko1@a...>
Date: Wed, 10 Jun 2020 02:45:29 +0900 (JST)
Subject: [ruby-changes:61645] 2ba2b32d9e (master): Freeing cc tables doesn't need access to ID

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

From 2ba2b32d9e8c6337d8f2292433b3ad920c7fa5ef Mon Sep 17 00:00:00 2001
From: Aaron Patterson <tenderlove@r...>
Date: Mon, 8 Jun 2020 16:55:10 -0700
Subject: Freeing cc tables doesn't need access to ID

We don't need to resolve symbols when freeing cc tables, so this commit
just changes the id table iterator to look at values rather than keys
and values.

diff --git a/gc.c b/gc.c
index 63f1629..547f9b2 100644
--- a/gc.c
+++ b/gc.c
@@ -2522,7 +2522,7 @@ cc_table_mark(rb_objspace_t *objspace, VALUE klass) https://github.com/ruby/ruby/blob/trunk/gc.c#L2522
 }
 
 static enum rb_id_table_iterator_result
-cc_table_free_i(ID id, VALUE ccs_ptr, void *data_ptr)
+cc_table_free_i(VALUE ccs_ptr, void *data_ptr)
 {
     struct cc_tbl_i_data *data = data_ptr;
     struct rb_class_cc_entries *ccs = (struct rb_class_cc_entries *)ccs_ptr;
@@ -2542,7 +2542,7 @@ cc_table_free(rb_objspace_t *objspace, VALUE klass, bool alive) https://github.com/ruby/ruby/blob/trunk/gc.c#L2542
             .klass = klass,
             .alive = alive,
         };
-        rb_id_table_foreach(cc_tbl, cc_table_free_i, &data);
+        rb_id_table_foreach_values(cc_tbl, cc_table_free_i, &data);
         rb_id_table_free(cc_tbl);
     }
 }
-- 
cgit v0.10.2


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

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