mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-01 23:13:40 +02:00
removed archaic gpointer derived_data; relict and added a GData member
Wed Mar 14 18:46:54 2001 Tim Janik <timj@gtk.org> * gscanner.[hc]: removed archaic gpointer derived_data; relict and added a GData member instead. * glist.[hc]: added g_list_remove_all(). * gslist.[hc]: added g_slist_remove_all(). Sat Mar 17 23:18:36 2001 Tim Janik <timj@gtk.org> * gobject.c (g_object_get_property): minor bug-fix. * gbsearcharray.[hc]: provide a macro for static initialization and functions g_bsearch_array_new() and g_bsearch_array_destroy() for dynamic allocations. * gboxed.c: introduce G_TYPE_GSTRING, boxed type for GString. * gclosure.[hc]: naming corrections. Fri Mar 9 16:42:08 2001 Tim Janik <timj@gtk.org> * gvaluetypes.[hc]: moved g_strdup_value_contents() into this file as a public function (was static in gobject.c before). it's a bit odd to have that function here, especially since it requires extra includes, but then it doesn't very well fit somewhere else either. * gparamspecs.c: added default/max/min checks to param spec creation functions.
This commit is contained in:
@@ -35,7 +35,6 @@
|
||||
/* pre allocation configurations
|
||||
*/
|
||||
#define MAX_STACK_VALUES (16)
|
||||
#define BSA_PRE_ALLOC (20)
|
||||
#define HANDLER_PRE_ALLOC (48)
|
||||
#define EMISSION_PRE_ALLOC (16)
|
||||
|
||||
@@ -141,6 +140,8 @@ static inline Emission* emission_find (Emission *emission_list,
|
||||
guint signal_id,
|
||||
GQuark detail,
|
||||
gpointer instance);
|
||||
static gint signal_key_cmp (gconstpointer node1,
|
||||
gconstpointer node2);
|
||||
static gboolean signal_emit_R (SignalNode *node,
|
||||
GQuark detail,
|
||||
gpointer instance,
|
||||
@@ -226,11 +227,12 @@ struct _HandlerMatch
|
||||
|
||||
|
||||
/* --- variables --- */
|
||||
static GBSearchArray g_signal_key_bsa = { NULL, 0, 0, 0, NULL };
|
||||
static GBSearchArray g_signal_key_bsa = G_STATIC_BSEARCH_ARRAY_INIT (sizeof (SignalKey),
|
||||
signal_key_cmp,
|
||||
G_BSEARCH_ARRAY_ALIGN_POWER2);
|
||||
static GHashTable *g_handler_list_bsa_ht = NULL;
|
||||
static Emission *g_recursive_emissions = NULL;
|
||||
static Emission *g_restart_emissions = NULL;
|
||||
static GTrashStack *g_bsa_ts = NULL;
|
||||
static GTrashStack *g_handler_ts = NULL;
|
||||
static GTrashStack *g_emission_ts = NULL;
|
||||
G_LOCK_DEFINE_STATIC (g_signal_mutex);
|
||||
@@ -314,14 +316,7 @@ handler_list_ensure (guint signal_id,
|
||||
|
||||
if (!hlbsa)
|
||||
{
|
||||
hlbsa = g_generic_node_alloc (&g_bsa_ts,
|
||||
sizeof (GBSearchArray),
|
||||
BSA_PRE_ALLOC);
|
||||
hlbsa->cmp_func = handler_lists_cmp;
|
||||
hlbsa->sizeof_node = sizeof (HandlerList);
|
||||
hlbsa->flags = G_BSEARCH_DEFER_SHRINK;
|
||||
hlbsa->n_nodes = 0;
|
||||
hlbsa->nodes = NULL;
|
||||
hlbsa = g_bsearch_array_new (sizeof (HandlerList), handler_lists_cmp, G_BSEARCH_ARRAY_DEFER_SHRINK);
|
||||
g_hash_table_insert (g_handler_list_bsa_ht, instance, hlbsa);
|
||||
}
|
||||
key.signal_id = signal_id;
|
||||
@@ -658,11 +653,6 @@ g_signal_init (void) /* sync with gtype.c */
|
||||
/* handler_id_node_prepend() requires this */
|
||||
g_assert (sizeof (GList) == sizeof (HandlerMatch));
|
||||
|
||||
/* setup signal key array */
|
||||
g_signal_key_bsa.cmp_func = signal_key_cmp;
|
||||
g_signal_key_bsa.sizeof_node = sizeof (SignalKey);
|
||||
g_signal_key_bsa.flags = G_BSEARCH_ALIGN_POWER2; /* alloc-only */
|
||||
|
||||
/* setup handler list binary searchable array hash table (in german, that'd be one word ;) */
|
||||
g_handler_list_bsa_ht = g_hash_table_new (g_direct_hash, NULL);
|
||||
|
||||
@@ -983,7 +973,7 @@ g_signal_list_ids (GType itype,
|
||||
|
||||
G_UNLOCK (g_signal_mutex);
|
||||
|
||||
return (guint *) g_array_free (result, FALSE);
|
||||
return (guint*) g_array_free (result, FALSE);
|
||||
}
|
||||
|
||||
guint
|
||||
@@ -1452,8 +1442,7 @@ g_signal_handlers_destroy (gpointer instance)
|
||||
}
|
||||
}
|
||||
}
|
||||
g_free (hlbsa->nodes);
|
||||
g_generic_node_free (&g_bsa_ts, hlbsa);
|
||||
g_bsearch_array_destroy (hlbsa);
|
||||
}
|
||||
G_UNLOCK (g_signal_mutex);
|
||||
}
|
||||
|
Reference in New Issue
Block a user