[#21338] $SAFE=4 での autoload — Hidetoshi NAGAI <nagai@...>

永井@知能.九工大です.

21 messages 2003/09/04
[#21346] Re: $SAFE=4 での autoload — nobu.nakada@... 2003/09/04

なかだです。

[#21359] Re: $SAFE=4 での autoload — Hidetoshi NAGAI <nagai@...> 2003/09/05

永井@知能.九工大です.

[#21419] Makefile.inのlex.c — Kazuhiro NISHIYAMA <zn@...>

西山和広です。

15 messages 2003/09/28

[ruby-dev:21295] volatile pointer/variable

From: nobu.nakada@...
Date: 2003-09-01 03:32:34 UTC
List: ruby-dev #21295
なかだです。

しばらく前の変更でrb_thread_start_0()のsaved_blockがvolatileへ
のポインタになりましたが、setjmp()/longjmp()でsaved_block自身の
値を保証するためであれば、ポインタの指す先をvolatileにしても意
味がないと思います。


Index: eval.c
===================================================================
RCS file: /cvs/ruby/src/ruby/eval.c,v
retrieving revision 1.526
diff -u -2 -p -r1.526 eval.c
--- eval.c	31 Aug 2003 13:47:47 -0000	1.526
+++ eval.c	1 Sep 2003 03:27:13 -0000
@@ -9337,5 +9337,5 @@ rb_thread_start_0(fn, arg, th_arg)
     volatile rb_thread_t th = th_arg;
     volatile VALUE thread = th->thread;
-    volatile struct BLOCK* saved_block = 0;
+    struct BLOCK *volatile saved_block = 0, *block;
     enum thread_status status;
     int state;
@@ -9395,10 +9395,10 @@ rb_thread_start_0(fn, arg, th_arg)
     rb_thread_remove(th);
 
-    while (saved_block) {
-	volatile struct BLOCK *tmp = saved_block;
+    for (block = saved_block; block;) {
+	struct BLOCK *tmp = block;
 
 	if (tmp->frame.argc > 0)
 	    free(tmp->frame.argv);
-	saved_block = tmp->prev;
+	block = tmp->prev;
 	free((void*)tmp);
     }


-- 
--- 僕の前にBugはない。
--- 僕の後ろにBugはできる。
    中田 伸悦

In This Thread

Prev Next