Re: Type checking



On 17/03/10 22:03, Andrew Cowie wrote:
in gtk/gtkbutton.c which after wading through several macros ends up as
a call to g_type_check_instance() in glib/gtype.c with some if/else
blocks around it.

[snip]

So I'm wondering: can we [C, GTK] do away with one of the code paths
entirely? It'd be nice to do away with the checks in the internal
accessors, of course, but that isn't going to happen because the
internal code is now using the public accessors.

So maybe we can at least not check in the cast macros?

Again, I haven't profiled a C only applcation in a while, so this may be
out of date. Someone with a GUI heavy C app would need to check. But
this used to be really expensive for C apps. And meanwhile we're using
GTK for some years now without using the cast macros at all, and things
are working. So that's at least a datapoint.

Isn't this why we have G_DISABLE_CAST_CHECKS ?

--
Regards,
Martyn


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]