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

ruby-changes:48563

From: ko1 <ko1@a...>
Date: Tue, 7 Nov 2017 13:53:17 +0900 (JST)
Subject: [ruby-changes:48563] ko1:r60678 (trunk): remove `rb_postponed_job_t::th`.

ko1	2017-11-07 13:53:11 +0900 (Tue, 07 Nov 2017)

  New Revision: 60678

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=60678

  Log:
    remove `rb_postponed_job_t::th`.
    
    * vm_trace.c (rb_postponed_job_t): remove `th` field because it is not used.

  Modified files:
    trunk/vm_trace.c
Index: vm_trace.c
===================================================================
--- vm_trace.c	(revision 60677)
+++ vm_trace.c	(revision 60678)
@@ -1500,7 +1500,6 @@ Init_vm_trace(void) https://github.com/ruby/ruby/blob/trunk/vm_trace.c#L1500
 
 typedef struct rb_postponed_job_struct {
     unsigned long flags; /* reserved */
-    struct rb_thread_struct *th; /* created thread, reserved */
     rb_postponed_job_func_t func;
     void *data;
 } rb_postponed_job_t;
@@ -1523,7 +1522,7 @@ enum postponed_job_register_result { https://github.com/ruby/ruby/blob/trunk/vm_trace.c#L1522
 };
 
 static enum postponed_job_register_result
-postponed_job_register(rb_thread_t *th, rb_vm_t *vm,
+postponed_job_register(rb_execution_context_t *ec, rb_vm_t *vm,
 		       unsigned int flags, rb_postponed_job_func_t func, void *data, int max, int expected_index)
 {
     rb_postponed_job_t *pjob;
@@ -1538,11 +1537,10 @@ postponed_job_register(rb_thread_t *th, https://github.com/ruby/ruby/blob/trunk/vm_trace.c#L1537
     }
 
     pjob->flags = flags;
-    pjob->th = th;
     pjob->func = func;
     pjob->data = data;
 
-    RUBY_VM_SET_POSTPONED_JOB_INTERRUPT(th->ec);
+    RUBY_VM_SET_POSTPONED_JOB_INTERRUPT(ec);
 
     return PJRR_SUCESS;
 }
@@ -1552,11 +1550,11 @@ postponed_job_register(rb_thread_t *th, https://github.com/ruby/ruby/blob/trunk/vm_trace.c#L1550
 int
 rb_postponed_job_register(unsigned int flags, rb_postponed_job_func_t func, void *data)
 {
-    rb_thread_t *th = GET_THREAD();
-    rb_vm_t *vm = th->vm;
+    rb_execution_context_t *ec = GET_EC();
+    rb_vm_t *vm = rb_ec_vm_ptr(ec);
 
   begin:
-    switch (postponed_job_register(th, vm, flags, func, data, MAX_POSTPONED_JOB, vm->postponed_job_index)) {
+    switch (postponed_job_register(ec, vm, flags, func, data, MAX_POSTPONED_JOB, vm->postponed_job_index)) {
       case PJRR_SUCESS     : return 1;
       case PJRR_FULL       : return 0;
       case PJRR_INTERRUPTED: goto begin;
@@ -1568,8 +1566,8 @@ rb_postponed_job_register(unsigned int f https://github.com/ruby/ruby/blob/trunk/vm_trace.c#L1566
 int
 rb_postponed_job_register_one(unsigned int flags, rb_postponed_job_func_t func, void *data)
 {
-    rb_thread_t *th = GET_THREAD();
-    rb_vm_t *vm = th->vm;
+    rb_execution_context_t *ec = GET_EC();
+    rb_vm_t *vm = rb_ec_vm_ptr(ec);
     rb_postponed_job_t *pjob;
     int i, index;
 
@@ -1578,11 +1576,11 @@ rb_postponed_job_register_one(unsigned i https://github.com/ruby/ruby/blob/trunk/vm_trace.c#L1576
     for (i=0; i<index; i++) {
 	pjob = &vm->postponed_job_buffer[i];
 	if (pjob->func == func) {
-	    RUBY_VM_SET_POSTPONED_JOB_INTERRUPT(th->ec);
+	    RUBY_VM_SET_POSTPONED_JOB_INTERRUPT(ec);
 	    return 2;
 	}
     }
-    switch (postponed_job_register(th, vm, flags, func, data, MAX_POSTPONED_JOB + MAX_POSTPONED_JOB_SPECIAL_ADDITION, index)) {
+    switch (postponed_job_register(ec, vm, flags, func, data, MAX_POSTPONED_JOB + MAX_POSTPONED_JOB_SPECIAL_ADDITION, index)) {
       case PJRR_SUCESS     : return 1;
       case PJRR_FULL       : return 0;
       case PJRR_INTERRUPTED: goto begin;

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

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