From: nobu.nakada@... Date: 2002-09-17T19:38:21+09:00 Subject: [ruby-dev:18310] * eval.c (rb_thread_remove): free stack buffer on remove. なかだです。 At Tue, 17 Sep 2002 09:36:05 +0000, matz wrote: > matz Tue, 17 Sep 2002 09:36:05 +0000 > Log: > * eval.c (rb_thread_remove): free stack buffer on remove. rb_thread_atfork()のときも解放しといたほうがいいような気がしま す。 Index: eval.c =================================================================== RCS file: /cvs/ruby/src/ruby/eval.c,v retrieving revision 1.329 diff -u -2 -p -r1.329 eval.c --- eval.c 17 Sep 2002 09:36:05 -0000 1.329 +++ eval.c 17 Sep 2002 10:21:54 -0000 @@ -7760,4 +7760,14 @@ rb_thread_ready(th) static void +rb_thread_die(th) + rb_thread_t th; +{ + th->gid = 0; + th->status = THREAD_KILLED; + if (th->stk_ptr) free(th->stk_ptr); + th->stk_ptr = 0; +} + +static void rb_thread_remove(th) rb_thread_t th; @@ -7766,10 +7776,7 @@ rb_thread_remove(th) rb_thread_ready(th); - th->status = THREAD_KILLED; - th->gid = 0; + rb_thread_die(th); th->prev->next = th->next; th->next->prev = th->prev; - if (th->stk_ptr) free(th->stk_ptr); - th->stk_ptr = 0; } @@ -9187,6 +9194,5 @@ rb_thread_atfork() FOREACH_THREAD(th) { if (th != curr_thread) { - th->gid = 0; - th->status = THREAD_KILLED; + rb_thread_die(th); } } -- --- 僕の前にBugはない。 --- 僕の後ろにBugはできる。 中田 伸悦