GType: add accessor for instance private offset

Since instance private data is now always at a constant offset to the
instance pointer, we can add an accessor for it that doesn't also
require an instance.

The idea is that classes can call this from their class_init and store
it in a file-scoped static variable and use that to find their private
data on instances very quickly, without a priv pointer.

https://bugzilla.gnome.org/show_bug.cgi?id=698056
This commit is contained in:
Ryan Lortie
2013-04-23 10:38:23 -04:00
parent eb860fd898
commit c30c0bb34d
3 changed files with 51 additions and 0 deletions

View File

@@ -125,6 +125,7 @@ g_type_check_is_value_type
g_type_check_value
g_type_check_value_holds
g_type_instance_get_private
g_type_class_get_instance_private_offset
g_type_class_get_private
g_type_test_flags
g_type_name_from_instance