Index: gobject/gobject.c
===================================================================
--- gobject/gobject.c	(revision 7583)
+++ gobject/gobject.c	(working copy)
@@ -113,6 +113,9 @@
     ((G_DATALIST_GET_FLAGS (&(object)->qdata) & OBJECT_HAS_TOGGLE_REF_FLAG) != 0)
 #define OBJECT_FLOATING_FLAG 0x2
 
+#define CLASS_HAS_PROPS_FLAG 0x1
+#define CLASS_HAS_PROPS(class) \
+	(G_UNLIKELY(class->flags & CLASS_HAS_PROPS_FLAG))
 
 /* --- signals --- */
 enum {
@@ -131,7 +134,8 @@
 static void	g_object_base_class_init		(GObjectClass	*class);
 static void	g_object_base_class_finalize		(GObjectClass	*class);
 static void	g_object_do_class_init			(GObjectClass	*class);
-static void	g_object_init				(GObject	*object);
+static void	g_object_init				(GObject	*object,
+							 GObjectClass	*class);
 static GObject*	g_object_constructor			(GType                  type,
 							 guint                  n_construct_properties,
 							 GObjectConstructParam *construct_params);
@@ -181,12 +185,11 @@
 static GQuark	            quark_closure_array = 0;
 static GQuark	            quark_weak_refs = 0;
 static GQuark	            quark_toggle_refs = 0;
+static GQuark	            quark_in_constr = 0;
 static GParamSpecPool      *pspec_pool = NULL;
 static GObjectNotifyContext property_notify_context = { 0, };
 static gulong	            gobject_signals[LAST_SIGNAL] = { 0, };
 static guint (*floating_flag_handler) (GObject*, gint) = object_floating_flag_handler;
-G_LOCK_DEFINE_STATIC (construction_mutex);
-static GSList *construction_objects = NULL;
 
 /* --- functions --- */
 #ifdef	G_ENABLE_DEBUG
@@ -320,6 +323,7 @@
 
   quark_weak_refs = g_quark_from_static_string ("GObject-weak-references");
   quark_toggle_refs = g_quark_from_static_string ("GObject-toggle-references");
+  quark_in_constr = g_quark_from_static_string ("GObject-in-construction");
   pspec_pool = g_param_spec_pool_new (TRUE);
   property_notify_context.quark_notify_queue = g_quark_from_static_string ("GObject-notify-queue");
   property_notify_context.dispatcher = g_object_notify_dispatcher;
@@ -405,6 +409,9 @@
 {
   g_return_if_fail (G_IS_OBJECT_CLASS (class));
   g_return_if_fail (G_IS_PARAM_SPEC (pspec));
+
+  class->flags |= CLASS_HAS_PROPS_FLAG;
+
   if (pspec->flags & G_PARAM_WRITABLE)
     g_return_if_fail (class->set_property != NULL);
   if (pspec->flags & G_PARAM_READABLE)
@@ -678,17 +685,19 @@
 }
 
 static void
-g_object_init (GObject *object)
+g_object_init (GObject		*object,
+	       GObjectClass	*class)
 {
   object->ref_count = 1;
   g_datalist_init (&object->qdata);
   
-  /* freeze object's notification queue, g_object_newv() preserves pairedness */
-  g_object_notify_queue_freeze (object, &property_notify_context);
-  /* enter construction list for notify_queue_thaw() and to allow construct-only properties */
-  G_LOCK (construction_mutex);
-  construction_objects = g_slist_prepend (construction_objects, object);
-  G_UNLOCK (construction_mutex);
+  if (CLASS_HAS_PROPS (class))
+    {
+      /* freeze object's notification queue, g_object_newv() preserves pairedness */
+      g_object_notify_queue_freeze (object, &property_notify_context);
+      /* enter construction list for notify_queue_thaw() and to allow construct-only properties */
+      g_datalist_id_set_data (&object->qdata, quark_in_constr, (gpointer) TRUE);
+    }
 
 #ifdef	G_ENABLE_DEBUG
   IF_DEBUG (OBJECTS)
@@ -1059,35 +1068,12 @@
   return object;
 }
 
-static gboolean
-slist_maybe_remove (GSList       **slist,
-                    gconstpointer  data)
-{
-  GSList *last = NULL, *node = *slist;
-  while (node)
-    {
-      if (node->data == data)
-        {
-          if (last)
-            last->next = node->next;
-          else
-            *slist = node->next;
-          g_slist_free_1 (node);
-          return TRUE;
-        }
-      last = node;
-      node = last->next;
-    }
-  return FALSE;
-}
 
 static inline gboolean
-object_in_construction_list (GObject *object)
+object_in_construction (GObject *object)
 {
   gboolean in_construction;
-  G_LOCK (construction_mutex);
-  in_construction = g_slist_find (construction_objects, object) != NULL;
-  G_UNLOCK (construction_mutex);
+  in_construction = (gboolean) g_datalist_id_get_data (&object->qdata, quark_in_constr);
   return in_construction;
 }
 
@@ -1109,7 +1095,7 @@
 	       guint       n_parameters,
 	       GParameter *parameters)
 {
-  GObjectConstructParam *cparams, *oparams;
+  GObjectConstructParam *cparams = NULL, *oparams;
   GObjectNotifyQueue *nqueue = NULL; /* shouldn't be initialized, just to silence compiler */
   GObject *object;
   GObjectClass *class, *unref_class = NULL;
@@ -1125,117 +1111,131 @@
   class = g_type_class_peek_static (object_type);
   if (!class)
     class = unref_class = g_type_class_ref (object_type);
-  for (slist = class->construct_properties; slist; slist = slist->next)
-    {
-      clist = g_list_prepend (clist, slist->data);
-      n_total_cparams += 1;
-    }
 
-  /* collect parameters, sort into construction and normal ones */
-  oparams = g_new (GObjectConstructParam, n_parameters);
-  cparams = g_new (GObjectConstructParam, n_total_cparams);
-  for (i = 0; i < n_parameters; i++)
+  if (CLASS_HAS_PROPS (class))
     {
-      GValue *value = &parameters[i].value;
-      GParamSpec *pspec = g_param_spec_pool_lookup (pspec_pool,
-						    parameters[i].name,
-						    object_type,
-						    TRUE);
-      if (!pspec)
-	{
-	  g_warning ("%s: object class `%s' has no property named `%s'",
-		     G_STRFUNC,
-		     g_type_name (object_type),
-		     parameters[i].name);
-	  continue;
-	}
-      if (!(pspec->flags & G_PARAM_WRITABLE))
-	{
-	  g_warning ("%s: property `%s' of object class `%s' is not writable",
-		     G_STRFUNC,
-		     pspec->name,
-		     g_type_name (object_type));
-	  continue;
-	}
-      if (pspec->flags & (G_PARAM_CONSTRUCT | G_PARAM_CONSTRUCT_ONLY))
-	{
-	  GList *list = g_list_find (clist, pspec);
+      for (slist = class->construct_properties; slist; slist = slist->next)
+        {
+          clist = g_list_prepend (clist, slist->data);
+          n_total_cparams += 1;
+        }
 
-	  if (!list)
+      /* collect parameters, sort into construction and normal ones */
+      oparams = g_new (GObjectConstructParam, n_parameters);
+      cparams = g_new (GObjectConstructParam, n_total_cparams);
+      for (i = 0; i < n_parameters; i++)
+        {
+          GValue *value = &parameters[i].value;
+          GParamSpec *pspec = g_param_spec_pool_lookup (pspec_pool,
+						        parameters[i].name,
+						        object_type,
+						        TRUE);
+          if (!pspec)
 	    {
-	      g_warning ("%s: construct property \"%s\" for object `%s' can't be set twice",
-                         G_STRFUNC, pspec->name, g_type_name (object_type));
+	      g_warning ("%s: object class `%s' has no property named `%s'",
+		         G_STRFUNC,
+		         g_type_name (object_type),
+		         parameters[i].name);
 	      continue;
 	    }
-	  cparams[n_cparams].pspec = pspec;
-	  cparams[n_cparams].value = value;
-	  n_cparams++;
-	  if (!list->prev)
-	    clist = list->next;
-	  else
-	    list->prev->next = list->next;
-	  if (list->next)
-	    list->next->prev = list->prev;
-	  g_list_free_1 (list);
-	}
-      else
-	{
-	  oparams[n_oparams].pspec = pspec;
-	  oparams[n_oparams].value = value;
-	  n_oparams++;
-	}
-    }
+          if (!(pspec->flags & G_PARAM_WRITABLE))
+	    {
+	      g_warning ("%s: property `%s' of object class `%s' is not writable",
+		         G_STRFUNC,
+		         pspec->name,
+		         g_type_name (object_type));
+	      continue;
+	    }
+          if (pspec->flags & (G_PARAM_CONSTRUCT | G_PARAM_CONSTRUCT_ONLY))
+	    {
+	      GList *list = g_list_find (clist, pspec);
 
-  /* set remaining construction properties to default values */
-  n_cvalues = n_total_cparams - n_cparams;
-  cvalues = g_new (GValue, n_cvalues);
-  while (clist)
-    {
-      GList *tmp = clist->next;
-      GParamSpec *pspec = clist->data;
-      GValue *value = cvalues + n_total_cparams - n_cparams - 1;
+	      if (!list)
+	        {
+	          g_warning ("%s: construct property \"%s\" for object `%s' can't be set twice",
+                             G_STRFUNC, pspec->name, g_type_name (object_type));
+	          continue;
+	        }
+	      cparams[n_cparams].pspec = pspec;
+	      cparams[n_cparams].value = value;
+	      n_cparams++;
+	      if (!list->prev)
+	        clist = list->next;
+	      else
+	        list->prev->next = list->next;
+	      if (list->next)
+	        list->next->prev = list->prev;
+	      g_list_free_1 (list);
+	    }
+          else
+	    {
+	      oparams[n_oparams].pspec = pspec;
+	      oparams[n_oparams].value = value;
+	      n_oparams++;
+	    }
+        }
 
-      value->g_type = 0;
-      g_value_init (value, G_PARAM_SPEC_VALUE_TYPE (pspec));
-      g_param_value_set_default (pspec, value);
+      /* set remaining construction properties to default values */
+      n_cvalues = n_total_cparams - n_cparams;
+      cvalues = g_new (GValue, n_cvalues);
+      while (clist)
+        {
+          GList *tmp = clist->next;
+          GParamSpec *pspec = clist->data;
+          GValue *value = cvalues + n_total_cparams - n_cparams - 1;
 
-      cparams[n_cparams].pspec = pspec;
-      cparams[n_cparams].value = value;
-      n_cparams++;
+          value->g_type = 0;
+          g_value_init (value, G_PARAM_SPEC_VALUE_TYPE (pspec));
+          g_param_value_set_default (pspec, value);
 
-      g_list_free_1 (clist);
-      clist = tmp;
+          cparams[n_cparams].pspec = pspec;
+          cparams[n_cparams].value = value;
+          n_cparams++;
+
+          g_list_free_1 (clist);
+          clist = tmp;
+        }
     }
 
   /* construct object from construction parameters */
   object = class->constructor (object_type, n_total_cparams, cparams);
-  /* free construction values */
-  g_free (cparams);
-  while (n_cvalues--)
-    g_value_unset (cvalues + n_cvalues);
-  g_free (cvalues);
 
+  if (CLASS_HAS_PROPS (class))
+    {
+      /* free construction values */
+      g_free (cparams);
+      while (n_cvalues--)
+        g_value_unset (cvalues + n_cvalues);
+      g_free (cvalues);
+    }
+
   /* adjust freeze_count according to g_object_init() and remaining properties */
-  G_LOCK (construction_mutex);
-  newly_constructed = slist_maybe_remove (&construction_objects, object);
-  G_UNLOCK (construction_mutex);
-  if (newly_constructed || n_oparams)
-    nqueue = g_object_notify_queue_freeze (object, &property_notify_context);
-  if (newly_constructed)
-    g_object_notify_queue_thaw (object, nqueue);
+  newly_constructed = (gboolean) g_datalist_id_get_data (&object->qdata, quark_in_constr);
+  g_datalist_id_remove_no_notify (&object->qdata, quark_in_constr);
 
+  if (CLASS_HAS_PROPS (class))
+    {
+      if (newly_constructed || n_oparams)
+        nqueue = g_object_notify_queue_freeze (object, &property_notify_context);
+      if (newly_constructed)
+        g_object_notify_queue_thaw (object, nqueue);
+    }
+
   /* run 'constructed' handler if there is one */
   if (newly_constructed && class->constructed)
     class->constructed (object);
 
-  /* set remaining properties */
-  for (i = 0; i < n_oparams; i++)
-    object_set_property (object, oparams[i].pspec, oparams[i].value, nqueue);
-  g_free (oparams);
+  if (CLASS_HAS_PROPS (class))
+    {
+      /* set remaining properties */
+      for (i = 0; i < n_oparams; i++)
+      object_set_property (object, oparams[i].pspec, oparams[i].value, nqueue);
+      g_free (oparams);
 
-  /* release our own freeze count and handle notifications */
-  if (newly_constructed || n_oparams)
-    g_object_notify_queue_thaw (object, nqueue);
+      /* release our own freeze count and handle notifications */
+      if (newly_constructed || n_oparams)
+      g_object_notify_queue_thaw (object, nqueue);
+    }
 
   if (unref_class)
     g_type_class_unref (unref_class);
@@ -1406,7 +1406,7 @@
 		     G_OBJECT_TYPE_NAME (object));
 	  break;
 	}
-      if ((pspec->flags & G_PARAM_CONSTRUCT_ONLY) && !object_in_construction_list (object))
+      if ((pspec->flags & G_PARAM_CONSTRUCT_ONLY) && !object_in_construction (object))
         {
           g_warning ("%s: construct property \"%s\" for object `%s' can't be set after construction",
                      G_STRFUNC, pspec->name, G_OBJECT_TYPE_NAME (object));
@@ -1622,7 +1622,7 @@
                G_STRFUNC,
                pspec->name,
                G_OBJECT_TYPE_NAME (object));
-  else if ((pspec->flags & G_PARAM_CONSTRUCT_ONLY) && !object_in_construction_list (object))
+  else if ((pspec->flags & G_PARAM_CONSTRUCT_ONLY) && !object_in_construction (object))
     g_warning ("%s: construct property \"%s\" for object `%s' can't be set after construction",
                G_STRFUNC, pspec->name, G_OBJECT_TYPE_NAME (object));
   else
Index: gobject/gobject.h
===================================================================
--- gobject/gobject.h	(revision 7583)
+++ gobject/gobject.h	(working copy)
@@ -344,8 +344,10 @@
   void	     (*constructed)		(GObject	*object);
 
   /*< private >*/
+  gsize		flags;
+
   /* padding */
-  gpointer	pdummy[7];
+  gpointer	pdummy[6];
 };
 /**
  * GObjectConstructParam:
