gvalue: New g_value_init_from_instance

Used for the commonly used case (in signal emission) where we
initialize and set a GValue for an instance

Includes a fast-path for GObject

Overall makes it 6 times faster than the previous combination
of g_value_init + g_value_set_instance

Makes signal emission around 10% faster

https://bugzilla.gnome.org/show_bug.cgi?id=731950
This commit is contained in:
Edward Hervey
2014-06-19 11:28:48 +02:00
committed by Ryan Lortie
parent f727c820b8
commit c5c3c320a2
4 changed files with 71 additions and 4 deletions

View File

@@ -137,6 +137,9 @@ void g_value_unset (GValue *value);
GLIB_AVAILABLE_IN_ALL
void g_value_set_instance (GValue *value,
gpointer instance);
GLIB_AVAILABLE_IN_2_42
void g_value_init_from_instance (GValue *value,
gpointer instance);
/* --- private --- */