From: Simon Strandgaard <0bz63fz3m1qt3001@...> Date: 2003-06-26T01:45:47+09:00 Subject: Re: collect info about ruby-api On Thu, 26 Jun 2003 02:12:53 +0900, Mauricio Fern�ndez wrote: > On Thu, Jun 26, 2003 at 01:05:10AM +0900, Simon Strandgaard wrote: >> > Some references: >> > http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/66013 >> > http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/66025 >> >> If I understand you correct, then its a sort of watermark mecanism, where >> you can take a snapshot of the current state and restore it later ? > > ???? I don't understand, so im guessing... as you can see im terrible at it :-) > It only makes Ruby remember where the stack starts so that it can scan > it later safely (ie. doesn't try to walk off the memory and die w/ a > segfault or alike). Maybe I will understand another day.. but right now im lost. >> Is it usable for rubyists whom is doing extensions/embedding ? > > You do normally not need it (it's called by ruby_init). You only have to > be aware of how it works for cases such as the one exposed in > http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/66022. > > If Init_stack is called in a deeper stack frame than the one where some > VALUE resides, Ruby won't see the later when it scans the stack and the > object will be GCed. Again.. I don't understand.. It will perhaps help if I knew in which situations Init_stack is useful. If you can explain it more verbose, I would be very happy :-) >> I think I need to see more examples of its usage before I understand. > > Check out the links I gave you. I did.. but I don't know its purpose :-) -- Simon Strandgaard