gtype: Add check for fundamental instance type

When checking whether an instance is of a given fundamental type (such
as G_TYPE_OBJECT), we can avoid over 60%+ of the cost of checking types.

https://bugzilla.gnome.org/show_bug.cgi?id=730984
This commit is contained in:
Edward Hervey
2014-05-28 10:57:28 +02:00
committed by Ryan Lortie
parent 03a48e1ade
commit 6072e3650f
3 changed files with 27 additions and 0 deletions

View File

@@ -34,6 +34,7 @@ G_TYPE_CLASS_GET_PRIVATE
G_TYPE_CHECK_INSTANCE
G_TYPE_CHECK_INSTANCE_CAST
G_TYPE_CHECK_INSTANCE_TYPE
G_TYPE_CHECK_INSTANCE_FUNDAMENTAL_TYPE
G_TYPE_CHECK_CLASS_CAST
G_TYPE_CHECK_CLASS_TYPE
G_TYPE_CHECK_VALUE
@@ -125,6 +126,7 @@ G_TYPE_FUNDAMENTAL_SHIFT
g_type_check_instance
g_type_check_instance_cast
g_type_check_instance_is_a
g_type_check_instance_is_fundamentally_a
g_type_check_class_cast
g_type_check_class_is_a
g_type_check_is_value_type