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

ruby-changes:57316

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

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

From e3fc30564e9466d6926f9d25a090dcf787bd5c33 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: Mon, 26 Aug 2019 15:53:57 +0900
Subject: rb_thread_create now free from ANYARGS

After 5e86b005c0f2ef30df2f9906c7e2f3abefe286a2, I now think ANYARGS is
dangerous and should be extinct.  This commit deletes ANYARGS from
rb_thread_create, which seems very safe to do.

diff --git a/include/ruby/intern.h b/include/ruby/intern.h
index f3d3c29..c5a7f05 100644
--- a/include/ruby/intern.h
+++ b/include/ruby/intern.h
@@ -474,7 +474,7 @@ VALUE rb_thread_wakeup(VALUE); https://github.com/ruby/ruby/blob/trunk/include/ruby/intern.h#L474
 VALUE rb_thread_wakeup_alive(VALUE);
 VALUE rb_thread_run(VALUE);
 VALUE rb_thread_kill(VALUE);
-VALUE rb_thread_create(VALUE (*)(ANYARGS), void*);
+VALUE rb_thread_create(VALUE (*)(void *), void*);
 int rb_thread_fd_select(int, rb_fdset_t *, rb_fdset_t *, rb_fdset_t *, struct timeval *);
 void rb_thread_wait_for(struct timeval);
 VALUE rb_thread_current(void);
diff --git a/thread.c b/thread.c
index db4326b..57ccfef 100644
--- a/thread.c
+++ b/thread.c
@@ -810,7 +810,7 @@ thread_start_func_2(rb_thread_t *th, VALUE *stack_start) https://github.com/ruby/ruby/blob/trunk/thread.c#L810
 }
 
 static VALUE
-thread_create_core(VALUE thval, VALUE args, VALUE (*fn)(ANYARGS))
+thread_create_core(VALUE thval, VALUE args, VALUE (*fn)(void *))
 {
     rb_thread_t *th = rb_thread_ptr(thval), *current_th = GET_THREAD();
     int err;
@@ -944,7 +944,7 @@ thread_initialize(VALUE thread, VALUE args) https://github.com/ruby/ruby/blob/trunk/thread.c#L944
 }
 
 VALUE
-rb_thread_create(VALUE (*fn)(ANYARGS), void *arg)
+rb_thread_create(VALUE (*fn)(void *), void *arg)
 {
     return thread_create_core(rb_thread_alloc(rb_cThread), (VALUE)arg, fn);
 }
diff --git a/thread_pthread.c b/thread_pthread.c
index 39c3ed0..cbe6aa0 100644
--- a/thread_pthread.c
+++ b/thread_pthread.c
@@ -2156,7 +2156,7 @@ timer_pthread_fn(void *p) https://github.com/ruby/ruby/blob/trunk/thread_pthread.c#L2156
 #endif /* UBF_TIMER_PTHREAD */
 
 static VALUE
-ubf_caller(const void *ignore)
+ubf_caller(void *ignore)
 {
     rb_thread_sleep_forever();
 
diff --git a/vm_core.h b/vm_core.h
index 74700f3..cb22fc4 100644
--- a/vm_core.h
+++ b/vm_core.h
@@ -975,7 +975,7 @@ typedef struct rb_thread_struct { https://github.com/ruby/ruby/blob/trunk/vm_core.h#L975
             VALUE args;
         } proc;
         struct {
-            VALUE (*func)(ANYARGS);
+            VALUE (*func)(void *);
             void *arg;
         } func;
     } invoke_arg;
-- 
cgit v0.10.2


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

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