From: Nikolai Weibull Date: 2010-07-10T18:40:26+09:00 Subject: [ruby-core:31175] Re: Why is there no standard way of creating a String from a char *? On Fri, Jul 9, 2010 at 15:47, Urabe Shyouhei wrote: > (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. OK, I���m convinced. Bummer. Thank you all for taking the time to answer my questions!