Hi,

At Mon, 7 Jun 2004 04:33:40 +0900,
Godot wrote in [ruby-talk:102597]:
> ---------------Start code---------------
> 
> #include <ruby.h>
> #include <iostream>
> #include <string>
> using namespace std;
  extern "C" void Init_stack(VALUE*);
> 
> void dontCrash(string s) 
> {
>   VALUE test = rb_str_new2( s.c_str( ) );
>   rb_gc_register_address(&test);
>   rb_gc( ); // Test if gc gets corrupted
>   rb_p( rb_str_new2(" stuff!!! ") );
>   rb_p( test );
>   rb_gc_unregister_address(&test);
> }
> 
> int main ()
> {
>     ruby_init ();
      VALUE dummy;
      Init_stack(&dummy);
>     ruby_init_loadpath ();
>     dontCrash("puts 'test'");
>     ruby_finalize();
> }

-- 
Nobu Nakada