[glib] Move offsets array from interface data member to TypeNode



commit fd3923aba2f827b47c54edc9728c953b9520fa52
Author: Benjamin Otte <otte redhat com>
Date:   Thu Feb 11 21:08:57 2010 +0100

    Move offsets array from interface data member to TypeNode
    
    We need to assign offsets when the interface is not yet instantiated.

 gobject/gtype.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/gobject/gtype.c b/gobject/gtype.c
index 6c8308f..edeca10 100644
--- a/gobject/gtype.c
+++ b/gobject/gtype.c
@@ -240,6 +240,7 @@ struct _TypeNode
   GData       *global_gdata;
   union {
     GAtomicArray iface_entries;		/* for !iface types */
+    GAtomicArray offsets;
   } _prot;
   GType       *prerequisites;
   GType        supers[1]; /* flexible array */
@@ -316,7 +317,6 @@ struct _IFaceData
   GClassFinalizeFunc dflt_finalize;
   gconstpointer      dflt_data;
   gpointer           dflt_vtable;
-  GAtomicArray       offsets;
 };
 
 struct _ClassData
@@ -555,7 +555,7 @@ lookup_iface_entry_I (volatile IFaceEntries *entries,
     return NULL;
 
   G_ATOMIC_ARRAY_DO_TRANSACTION
-    (&iface_node->data->iface.offsets, guint8,
+    (&iface_node->_prot.offsets, guint8,
 
      entry = NULL;
      offsets = transaction_data;
@@ -1242,7 +1242,7 @@ iface_node_has_available_offset_L (TypeNode *iface_node,
 {
   guint8 *offsets;
 
-  offsets = G_ATOMIC_ARRAY_GET_LOCKED (&iface_node->data->iface.offsets, guint8);
+  offsets = G_ATOMIC_ARRAY_GET_LOCKED (&iface_node->_prot.offsets, guint8);
   if (offsets == NULL)
     return TRUE;
 
@@ -1293,7 +1293,7 @@ iface_node_set_offset_L (TypeNode *iface_node,
   int new_size, old_size;
   int i;
 
-  old_offsets = G_ATOMIC_ARRAY_GET_LOCKED (&iface_node->data->iface.offsets, guint8);
+  old_offsets = G_ATOMIC_ARRAY_GET_LOCKED (&iface_node->_prot.offsets, guint8);
   if (old_offsets == NULL)
     old_size = 0;
   else
@@ -1305,7 +1305,7 @@ iface_node_set_offset_L (TypeNode *iface_node,
     }
   new_size = MAX (old_size, offset + 1);
 
-  offsets = _g_atomic_array_copy (&iface_node->data->iface.offsets,
+  offsets = _g_atomic_array_copy (&iface_node->_prot.offsets,
 				  0, new_size - old_size);
 
   /* Mark new area as unused */
@@ -1314,7 +1314,7 @@ iface_node_set_offset_L (TypeNode *iface_node,
 
   offsets[offset] = index + 1;
 
-  _g_atomic_array_update (&iface_node->data->iface.offsets, offsets);
+  _g_atomic_array_update (&iface_node->_prot.offsets, offsets);
 }
 
 static void



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]