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

ruby-changes:57321

From: =E5=8D=9C=E9=83=A8=E6=98=8C=E5=B9=B3 <ko1@a...>
Date: Tue, 27 Aug 2019 17:48:39 +0900 (JST)
Subject: [ruby-changes:57321] 卜部昌平: bd8dc2561d (master): struct MEMO now free from ANYARGS

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

From bd8dc2561d4983df7bf44dbc6ca194930532adc7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=8D=9C=E9=83=A8=E6=98=8C=E5=B9=B3?=
 <shyouhei@r...>
Date: Tue, 27 Aug 2019 12:29:00 +0900
Subject: struct MEMO now free from ANYARGS

After 5e86b005c0f2ef30df2f9906c7e2f3abefe286a2, I now think ANYARGS is
dangerous and should be extinct.  There is only one usage of
MEMO::u3::func in load.c (where void Init_Foobar(vodi) is registered)
so why not just be explicit.

diff --git a/internal.h b/internal.h
index 5e73c11..7d6bf1e 100644
--- a/internal.h
+++ b/internal.h
@@ -1245,7 +1245,7 @@ struct MEMO { https://github.com/ruby/ruby/blob/trunk/internal.h#L1245
 	long cnt;
 	long state;
         const VALUE value;
-	VALUE (*func)(ANYARGS);
+        void (*func)(void);
     } u3;
 };
 
diff --git a/load.c b/load.c
index bc7abf1..3a21f5c 100644
--- a/load.c
+++ b/load.c
@@ -728,7 +728,7 @@ load_lock(const char *ftptr) https://github.com/ruby/ruby/blob/trunk/load.c#L728
     }
     else if (imemo_type_p(data, imemo_memo)) {
 	struct MEMO *memo = MEMO_CAST(data);
-	void (*init)(void) = (void (*)(void))memo->u3.func;
+        void (*init)(void) = memo->u3.func;
 	data = (st_data_t)rb_thread_shield_new();
 	st_insert(loading_tbl, (st_data_t)ftptr, data);
 	(*init)();
-- 
cgit v0.10.2


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

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