(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.