From: ts Date: 2001-06-17T17:02:31+09:00 Subject: [ruby-talk:16554] Re: garbage collection with rb_eval_string >>>>> "W" == Wesley J Landaker writes: W> VALUE result = rb_eval_string(...); W> The question is... how do I tell ruby I'm going to be using the result, W> so that it will not be garbage collected? Well, it depend what you are doing but generally you don't need to do anything because ruby mark the values which are on the stack. If you want to have a VALUE with a longer "life" you can define a global variable and declare it with rb_global_variable() (see README.EXT). Another possibilty is to use a struct (Data_Make_Struct) which define its own mark function, and declare this struct as a thread local variable (i.e. rb_thread_local_aref() and rb_thread_local_aset()). Guy Decoux