From: ts Date: 2003-03-01T00:16:54+09:00 Subject: Re: I'm stuck >>>>> "F" == Friedrich Dominicus writes: F> Ok I understand that now, what do I have to do that it does not F> happen? Well in my case you need to write void tt() { char i; VALUE obj; obj = rb_str_new2("a string"); /* call some ruby functions which call the GC */ i = RSTRING(obj)->ptr[0]; } int main(void) { ruby_init(); ruby_init_loadpath(); tt(); return 0; } Now the GC will see `obj' on the stack and will mark the string. The problem with my example int main(void) { char i; VALUE obj; VALUE klass; ruby_init(); obj = rb_str_new2("a string"); /* etc */ } is that ruby can't see that `klass' and `obj' are on the stack and it will not be marked by the GC. Guy Decoux