[Webkit-unassigned] [Bug 33590] [GTK] GObject DOM bindings

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Feb 1 06:16:24 PST 2010


https://bugs.webkit.org/show_bug.cgi?id=33590





--- Comment #29 from Xan Lopez <xan.lopez at gmail.com>  2010-02-01 06:16:21 PST ---
(In reply to comment #28)
> > 
> > gchar* and char* are exactly the same thing, one is just a typedef for the
> > other. The functions return UTF8-encoded NULL-terminated char arrays, that need
> > to be freed manually.
> 
> There is a subtle difference. g_strdup may be using a different memory
> allocator, such as GSlice, as opposed to strdup. So using gchar* for the return
> type makes it clear that g_free rather than free should be used to release the
> memory.

When inside a glib/gobject project all memory should be freed using the glib
functions, g_free, g_slice_free, etc. This is IMHO an orthogonal issue wrt
whether you use 'gchar' or 'char', which are identical and basically considered
bad ideas even by the people who first thought it was desirable to introduce
extra names like that when portability is not an issue. We could, and probably
should, stop using 'gchar' or 'gint' inside WebKitGTK+, and you'd still need to
use g_free to free our strings, so the idea that this is somehow related to
what name you use for your types is not correct IMHO.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list