From: nobu.nokada@... Date: 2003-07-02T22:43:48+09:00 Subject: Re: rb_gc() and scan stack Hi, At Wed, 2 Jul 2003 22:18:15 +0900, Simon Strandgaard wrote: > I tried drawing on some paper, what is happening.. > My initial drawing were wrong.. Now I understand. > No problemo: Incorrect. G == rb_gc_stack_start (set by Init_stack). --[ 0 ]----------------- bottom [.....................] top | --[ 1 ]----------------- entering ruby_init() bottom [.......G.............] top | --[ 2 ]----------------- leaving ruby_init() bottom [.RRRRRRG.............] top | --[ 3 ]----------------- entering Init_dummy() bottom [..RRRRRG.............] top | --[ 4 ]----------------- leaving Init_dummy() bottom [.RRRRRRG.............] top | --[ 5 ]----------------- entering test() bottom [......RG.............] top | --[ 6 ]----------------- instance = Dummy.new The instance is not within the mark-area, therefore it dies! bottom [....i.RG.............] top | > If we redo from step6 with Init_stack(begin).. with a > lower begin address, then things will work. --[ 6a ]----------------- Init_stack(current_stack_ptr) bottom [...G.................] top | --[ 7a ]----------------- instance = Dummy.new This time the instance is within the area, and will thus survive bottom [...GRiR..............] top | -- Nobu Nakada