mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-01 06:33:41 +02:00
variant of class_peek() which works for static types only.
Thu Nov 27 17:53:52 2003 Tim Janik <timj@gtk.org> * gtype.[hc]: (g_type_class_peek_static): variant of class_peek() which works for static types only. * gobject.c: (g_object_do_class_init): make ::notify a run-action signal. (g_object_newv): use g_type_class_peek_static() by default to speed up common code path (trades two write-locks for one read-lock). (g_object_disconnect): (g_object_connect): allow signal specification words to be seperated by '-'. (g_object_set_valist): (g_object_new_valist): don't leak values. (g_object_get_property): check property for readability. (g_object_set_property): check property for writability and to not be construct-only. (g_object_set_valist): check property to not be construct-only.
This commit is contained in:
@@ -2462,6 +2462,25 @@ g_type_class_peek (GType type)
|
||||
return class;
|
||||
}
|
||||
|
||||
gpointer
|
||||
g_type_class_peek_static (GType type)
|
||||
{
|
||||
TypeNode *node;
|
||||
gpointer class;
|
||||
|
||||
node = lookup_type_node_I (type);
|
||||
G_READ_LOCK (&type_rw_lock);
|
||||
if (node && node->is_classed && node->data &&
|
||||
/* peek only static types: */ node->plugin == NULL &&
|
||||
node->data->class.class) /* common.ref_count _may_ be 0 */
|
||||
class = node->data->class.class;
|
||||
else
|
||||
class = NULL;
|
||||
G_READ_UNLOCK (&type_rw_lock);
|
||||
|
||||
return class;
|
||||
}
|
||||
|
||||
gpointer
|
||||
g_type_class_peek_parent (gpointer g_class)
|
||||
{
|
||||
|
Reference in New Issue
Block a user