On Wed, 02 Jul 2003 01:37:11 +0200, Simon Strandgaard wrote: > I were experimenting with Init_stack, when I discovered a flaw in my mind. > > I thought that: local variables on stack would be marked in the > mark-phase and therefore survive the sweep-phase. > > But my instance is being destroyed.. why ? > > Can someone enligthen me ? > [snip] > > As you can see the 'free' is occuring between '1' and '2'. > > I thought 'free' was suppose to happen between '2' and '3' ? > Expecting output should look like this: Init_stack() did solve it :-).. The funny thing is that I were looking for a short+simple example to illustrate usage of Init_stack(). http://www.rubygarden.org/ruby?RubyApi/InitStack The modification I made were this: extern "C" void Init_stack(void *); void test() { volatile void *tmp; Init_stack((void*)&tmp); // comment this line and then step 1_2 will fail. Im *still* confused about the rb_gc_stack_start value in my first posting. Why does it fail in step (1_2), Can someone enligthen me ??? -- Simon Strandgaard