*/
-/* pre allocation configurations
- */
-#define MAX_STACK_VALUES (16)
-
#define REPORT_BUG "please report occurrence circumstances to gtk-devel-list@gnome.org"
#ifdef G_ENABLE_DEBUG
#define IF_DEBUG(debug_type, cond) if ((_g_type_debug_flags & G_TYPE_DEBUG_ ## debug_type) || cond)
* g_signal_override_class_closure() or
* g_signal_override_class_handler()and chained to with
* g_signal_chain_from_overridden() or
- * g_signal_chain_from_overridden().
+ * g_signal_chain_from_overridden_handler().
*
* See g_signal_new() for information about signal names.
*
if (closure)
{
- GValue *instance_and_params, *free_me = NULL;
+ GValue *instance_and_params;
GType signal_return_type;
GValue *param_values;
va_list var_args;
va_start (var_args, instance);
signal_return_type = node->return_type;
- free_me = g_new (GValue, node->n_params + 1);
- instance_and_params = free_me;
+ instance_and_params = g_slice_alloc (sizeof (GValue) * (n_params + 1));
param_values = instance_and_params + 1;
for (i = 0; i < node->n_params; i++)
while (i--)
g_value_unset (param_values + i);
- g_free (free_me);
+ g_slice_free1 (sizeof (GValue) * (n_params + 1), instance_and_params);
va_end (var_args);
return;
}
for (i = 0; i < n_params; i++)
g_value_unset (param_values + i);
g_value_unset (instance_and_params);
- if (free_me)
- g_free (free_me);
+ g_slice_free1 (sizeof (GValue) * (n_params + 1), instance_and_params);
va_end (var_args);
GQuark detail,
va_list var_args)
{
- GValue *instance_and_params, stack_values[MAX_STACK_VALUES], *free_me = NULL;
+ GValue *instance_and_params;
GType signal_return_type;
GValue *param_values;
SignalNode *node;
n_params = node->n_params;
signal_return_type = node->return_type;
- if (node->n_params < MAX_STACK_VALUES)
- instance_and_params = stack_values;
- else
- {
- free_me = g_new (GValue, node->n_params + 1);
- instance_and_params = free_me;
- }
+ instance_and_params = g_slice_alloc (sizeof (GValue) * (n_params + 1));
param_values = instance_and_params + 1;
+
for (i = 0; i < node->n_params; i++)
{
gchar *error;
GType ptype = node->param_types[i] & ~G_SIGNAL_TYPE_STATIC_SCOPE;
gboolean static_scope = node->param_types[i] & G_SIGNAL_TYPE_STATIC_SCOPE;
-
+
param_values[i].g_type = 0;
SIGNAL_UNLOCK ();
g_value_init (param_values + i, ptype);
while (i--)
g_value_unset (param_values + i);
- g_free (free_me);
+ g_slice_free1 (sizeof (GValue) * (n_params + 1), instance_and_params);
return;
}
SIGNAL_LOCK ();
for (i = 0; i < n_params; i++)
g_value_unset (param_values + i);
g_value_unset (instance_and_params);
- if (free_me)
- g_free (free_me);
+ g_slice_free1 (sizeof (GValue) * (n_params + 1), instance_and_params);
}
/**