+Tue Feb 3 21:24:01 2004 Tim Janik <timj@gtk.org>
+
+ * gtype.h (_G_TYPE_CVH): provide a short-cut version for
+ this macro in case value->g_type==checked_type for gcc, similar
+ to instance and class check short-cuts. this speeds up code that
+ makes frequent use of G_VALUE_HOLDS_*() (e.g. setters/getters).
+
+ * gtype.c (type_data_last_unref_Wm): don't call class-cache functions
+ for the uncached case, this rendered g_type_class_unref_uncached()
+ useless. pointed out by Stefan Westerfeld.
+
Sat Jan 24 18:20:13 2004 Tim Janik <timj@gtk.org>
* gtype.h: prefixed the parent_class variable defined by G_DEFINE_TYPE()
type_descriptive_name_I (type));
return;
}
-
- if (node->is_classed && node->data && node->data->class.class && static_n_class_cache_funcs)
+
+ /* call class cache hooks */
+ if (node->is_classed && node->data && node->data->class.class && static_n_class_cache_funcs && !uncached)
{
guint i;
# define _G_TYPE_CCC(cp, gt, ct) ((ct*) cp)
#endif /* G_DISABLE_CAST_CHECKS */
#define _G_TYPE_CHI(ip) (g_type_check_instance ((GTypeInstance*) ip))
-#define _G_TYPE_CVH(vl, gt) (g_type_check_value_holds ((GValue*) vl, gt))
#define _G_TYPE_CHV(vl) (g_type_check_value ((GValue*) vl))
#define _G_TYPE_IGC(ip, gt, ct) ((ct*) (((GTypeInstance*) ip)->g_class))
#define _G_TYPE_IGI(ip, gt, ct) ((ct*) g_type_interface_peek (((GTypeInstance*) ip)->g_class, gt))
__r = g_type_check_class_is_a (__class, __t); \
__r; \
}))
+# define _G_TYPE_CVH(vl, gt) (G_GNUC_EXTENSION ({ \
+ GValue *__val = (GValue*) vl; GType __t = gt; gboolean __r; \
+ if (__val && __val->g_type == __t) \
+ __r = TRUE; \
+ else \
+ __r = g_type_check_value_holds (__val, __t); \
+ __r; \
+}))
#else /* !__GNUC__ */
# define _G_TYPE_CIT(ip, gt) (g_type_check_instance_is_a ((GTypeInstance*) ip, gt))
# define _G_TYPE_CCT(cp, gt) (g_type_check_class_is_a ((GTypeClass*) cp, gt))
+# define _G_TYPE_CVH(vl, gt) (g_type_check_value_holds ((GValue*) vl, gt))
#endif /* !__GNUC__ */
#define G_TYPE_FLAG_RESERVED_ID_BIT ((GType) (1 << 0))
extern GTypeDebugFlags _g_type_debug_flags;