From: Urabe Shyouhei Date: 2010-07-09T22:47:25+09:00 Subject: [ruby-core:31159] Re: Why is there no standard way of creating a String from a char *? (2010/07/09 22:24), Nikolai Weibull wrote: > So basically there is no way to wrap, for example, > > http://library.gnome.org/devel/gio/stable/GFile.html#g-file-load-contents > > efficiently. I���ll always have to copy the loaded contents into a new > Ruby String and then free the returned char * contents. This is absolutely true, because g_free() and ruby's xfree() are not guaranteed to share the same free() implementation. That can happen on Windows. Given g_file_load_contents()'s returning memory regions is stated to "be freed using g_free()", it should not be done by Ruby's.