glib/gobject
Ryan Lortie bfa8bef7b9 GObject: substantially rework g_object_new()
Make a number of improvements to g_object_new():

 - instead of looking up the GParamSpec for the named property once in
   g_object_new() (in order to collect) and then again in g_object_newv
   (when actually setting the property), g_object_new_internal() is a
   new function that takes the GParamSpec on the interface to avoid the
   second lookup

 - in the case that ->constructor() is not set, we need not waste time
   creating an array of GObjectConstructParam to pass in.  Just directly
   iterate the list of parameters, calling set_property() on each.

 - instead of playing with linked lists to keep track of the construct
   properties, realise that the number of construct properties that we
   will set is exactly equal to the length of the construct_properties
   list on GObjectClass and the only thing that may change is where the
   value comes from (in the case that it was passed in)

   This assumption was already implicit in the existing code and can be
   seen from the sizing of the array used to hold the construct
   properties, but it wasn't taken advantage of to make things simpler.

 - instead of allocating and filling a separate array of the
   non-construct properties just re-iterate the passed-in list and set
   all properties that were not marked G_PARAM_CONSTRUCT (since the ones
   that were construct params were already used during construction)

 - use the new g_param_spec_get_default_value() API instead of
   allocating and setting the GValue for each construct property that
   wasn't passed from the user

Because we are now iterating the linked list of properties in-order we
need to append to that list during class initialising instead of
prepending.

These changes show a very small improvement on the simple-construction
performance testcase (probably just noise) and they improve the
complex-construction case by ~30%.

Thanks to Alex Larsson for reviews and fixes.

https://bugzilla.gnome.org/show_bug.cgi?id=698056
2013-04-23 14:39:09 -04:00
..
tests GParamSpec: add g_param_spec_get_default_value() 2013-04-23 14:39:09 -04:00
.gitignore Stop using glib-genmarshal at build time 2011-06-20 17:24:07 -04:00
ChangeLog Update README files to refer to git 2009-03-31 19:39:16 -04:00
gatomicarray.c Improvde #include order consistency 2013-01-01 13:54:54 -05:00
gatomicarray.h Move single-include guards inside include guards 2012-12-27 23:43:14 -05:00
gbinding.c Fix binding properties of the same object 2012-03-04 20:49:04 -05:00
gbinding.h various: add GLIB_AVAILABLE_IN_ALL everywhere else 2013-01-13 13:11:57 -05:00
gboxed.c gmarkup: Make GMarkupParseContext a boxed type 2013-01-01 11:03:19 -05:00
gboxed.h various: add GLIB_AVAILABLE_IN_ALL everywhere else 2013-01-13 13:11:57 -05:00
gclosure.c Improvde #include order consistency 2013-01-01 13:54:54 -05:00
gclosure.h various: add GLIB_AVAILABLE_IN_ALL everywhere else 2013-01-13 13:11:57 -05:00
genums.c documentation fixes 2011-12-13 23:01:51 -05:00
genums.h various: add GLIB_AVAILABLE_IN_ALL everywhere else 2013-01-13 13:11:57 -05:00
glib-genmarshal.c Revert "Improvde #include order consistency" 2013-01-15 19:35:52 +08:00
glib-mkenums.in glib-mkenums: fix handling of forward enum declarations 2012-02-07 13:32:22 -05:00
glib-types.h various: add GLIB_AVAILABLE_IN_ALL everywhere else 2013-01-13 13:11:57 -05:00
gmarshal.c Use G_VA_COPY instead of va_copy() 2012-03-08 14:51:22 +08:00
gmarshal.h gmarshal.h: replace "extern" with GLIB_AVAILABLE_IN_ALL 2013-01-13 13:13:55 -05:00
gmarshal.list Update the comment in gmarshal.list 2012-06-23 17:53:22 -04:00
gobject_probes.d Add missing semicolons to gobject_probes.d 2012-10-15 19:48:44 -04:00
gobject_trace.h Add dtrace and systemtap support for gobject 2010-05-27 14:51:41 -04:00
gobject-query.c Remove g_type_init() calls 2012-10-16 09:39:24 -04:00
gobject.c GObject: substantially rework g_object_new() 2013-04-23 14:39:09 -04:00
gobject.h Doc: clarify set_property() vfunc 2013-03-15 09:07:30 +01:00
gobject.py Initial support for gdb python macros 2009-09-21 15:39:00 +02:00
gobject.rc.in Update the year in the *.rc.in files 2011-06-07 08:55:31 +08:00
gobject.stp.in Add dtrace and systemtap support for gobject 2010-05-27 14:51:41 -04:00
gobjectnotifyqueue.c [notify] add warning to gobjectnotifyqueue.c 2011-11-16 17:50:13 +00:00
gparam.c GParamSpec: add g_param_spec_get_default_value() 2013-04-23 14:39:09 -04:00
gparam.h GParamSpec: add g_param_spec_get_default_value() 2013-04-23 14:39:09 -04:00
gparamspecs.c GParamSpec: Make constructors introspectable 2013-01-14 11:36:14 +01:00
gparamspecs.h Add a new _GLIB_EXTERN macro for "extern" 2013-01-13 13:13:36 -05:00
gsignal.c gsignal: improve warning output 2013-02-22 00:54:50 +00:00
gsignal.h various: add GLIB_AVAILABLE_IN_ALL everywhere else 2013-01-13 13:11:57 -05:00
gsourceclosure.c Install an invalidation notifier for GClosure in g_source_set_closure() 2013-01-20 16:23:32 +01:00
gsourceclosure.h various: add GLIB_AVAILABLE_IN_ALL everywhere else 2013-01-13 13:11:57 -05:00
gtype-private.h Revert "GObject: prevent installing properties after init" 2013-04-22 18:32:49 -04:00
gtype.c GType: add accessor for instance private offset 2013-04-23 14:39:09 -04:00
gtype.h GType: add accessor for instance private offset 2013-04-23 14:39:09 -04:00
gtypemodule.c Do not use static GTypeInfo and GInterfaceInfo 2011-11-29 22:03:25 -05:00
gtypemodule.h various: add GLIB_AVAILABLE_IN_ALL everywhere else 2013-01-13 13:11:57 -05:00
gtypeplugin.c Do not use static GTypeInfo and GInterfaceInfo 2011-11-29 22:03:25 -05:00
gtypeplugin.h various: add GLIB_AVAILABLE_IN_ALL everywhere else 2013-01-13 13:11:57 -05:00
gvalue.c Remove g_type_init() calls 2012-10-16 09:39:24 -04:00
gvalue.h various: add GLIB_AVAILABLE_IN_ALL everywhere else 2013-01-13 13:11:57 -05:00
gvaluearray.c Add G_GNUC_BEGIN/END_IGNORE_DEPRECATIONS 2012-02-15 09:54:38 -05:00
gvaluearray.h GValueArray: clarify the deprecation warnings 2013-01-02 13:02:51 -05:00
gvaluecollector.h Constify collect and lcopy strings in GTypeValueTable 2012-07-05 23:27:35 -04:00
gvaluetransform.c valuetransform: Fix definition of ulong_bool 2012-06-27 10:59:29 +02:00
gvaluetypes.c values: Use v_pointer for g_value_set_gtype() 2012-01-14 01:15:16 +01:00
gvaluetypes.h various: add GLIB_AVAILABLE_IN_ALL everywhere else 2013-01-13 13:11:57 -05:00
libgobject-gdb.py.in Avoid shadowing the dir builtin 2010-12-03 14:08:36 -05:00
Makefile.am build: Add --disable-compile-warnings 2013-02-27 08:34:01 -05:00
makefile.msc.in gobject/: fully remove gobjectalias hacks 2010-07-07 19:40:48 -04:00
marshal-genstrings.pl Hacky script to fix up your .msc.in files on windows. Dunno if this is a 2001-08-04 15:49:55 +00:00