Add type_data_ref_U() and use it in g_type_class_ref()
authorEdward Hervey <bilboed@bilboed.com>
Thu, 24 Sep 2009 10:42:49 +0000 (12:42 +0200)
committerAlexander Larsson <alexl@redhat.com>
Mon, 30 Nov 2009 19:52:33 +0000 (20:52 +0100)
commit35c376a8a6be94f6fd5c22164a5e0968f4d3e26e
tree1f48d3abadb9d4b8aaf2743a8cb23a612a6cce91
parent5160175656797fde6b301b0d832b692052b96e3e
Add type_data_ref_U() and use it in g_type_class_ref()

The function returns TRUE if the type was previously initialized and can
be easily reused. It returns FALSE and does not take a reference if the
type is not referenced yet.

g_type_class_ref() uses this to avoid taking locks in the common path,
which speeds up object creation a lot - in particular in multithreaded
applications.

https://bugzilla.gnome.org/show_bug.cgi?id=585375
gobject/gtype.c