From: Tomasz Wegrzanowski Date: 2001-12-28T16:26:47+09:00 Subject: [ruby-talk:29515] C extensions: ruby and C strings 1) Should I free string here or is it used as string buffer by Ruby ? char *cstr; VALUE rstr; rstr = rb_str_new2(cstr); free (cstr); // ??? 2) Does cstr point to Ruby string buffer or should I free it ? VALUE rstr; char *cstr; cstr = rb_str2cstr (rstr, 0); do_something_with_const_string (cstr); free (cstr); // ??? 3) Is RSTRING(rstr)->ptr null-terminated ?