mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-01 15:03:39 +02:00
gobject: Speed up property lookup
When the param specs are provided as an array with g_object_class_install_properties, keep a copy of that array around and use it for looking up properties without the param spec pool. Note that this is an opportunistic optimization - currently, it only works for properties of the class itself, not for parent classes, and it only works if the property names are identical string literals (we're at the mercy of the linker for that). If we don't get lucky, we fall back to using the pspec pool as usual.
This commit is contained in:
@@ -370,8 +370,12 @@ struct _GObjectClass
|
||||
gsize flags;
|
||||
|
||||
gsize n_construct_properties;
|
||||
|
||||
gpointer pspecs;
|
||||
gsize n_pspecs;
|
||||
|
||||
/* padding */
|
||||
gpointer pdummy[5];
|
||||
gpointer pdummy[3];
|
||||
};
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user