From 8b977e9046cb2d04ac59e6b8b19eded6933c9adc Mon Sep 17 00:00:00 2001 From: Robert Mader Date: Mon, 19 Oct 2020 19:57:45 +0200 Subject: [PATCH] clutter: Stop using GSlice It has been inofficially deprecated for years, is known to cause issues with valgrind and potentially hides memory corruption. Lets stop using it. Part-of: --- clutter/clutter/cally/cally-actor.c | 4 +-- clutter/clutter/clutter-actor-box.c | 6 ++--- clutter/clutter/clutter-actor.c | 26 +++++++++---------- clutter/clutter/clutter-base-types.c | 6 ++--- clutter/clutter/clutter-bezier.c | 4 +-- clutter/clutter/clutter-binding-pool.c | 4 +-- clutter/clutter/clutter-color.c | 6 ++--- clutter/clutter/clutter-event.c | 8 +++--- clutter/clutter/clutter-id-pool.c | 4 +-- clutter/clutter/clutter-main.c | 12 ++++----- .../clutter/clutter-paint-volume-private.h | 2 +- clutter/clutter/clutter-paint-volume.c | 8 +++--- clutter/clutter/clutter-path.c | 12 ++++----- clutter/clutter/clutter-script-parser.c | 8 +++--- clutter/clutter/clutter-script.c | 6 ++--- clutter/clutter/clutter-shader-effect.c | 4 +-- clutter/clutter/clutter-shader-types.c | 18 ++++++------- clutter/clutter/clutter-stage.c | 8 +++--- clutter/clutter/clutter-timeline.c | 6 ++--- clutter/clutter/clutter-units.c | 4 +-- clutter/clutter/clutter-util.c | 6 ++--- 21 files changed, 81 insertions(+), 81 deletions(-) diff --git a/clutter/clutter/cally/cally-actor.c b/clutter/clutter/cally/cally-actor.c index 2c4c1f34d..fcaf9e1db 100644 --- a/clutter/clutter/cally/cally-actor.c +++ b/clutter/clutter/cally/cally-actor.c @@ -1090,7 +1090,7 @@ cally_actor_add_action_full (CallyActor *cally_actor, priv = cally_actor->priv; - info = g_slice_new (CallyActorActionInfo); + info = g_new0 (CallyActorActionInfo, 1); info->name = g_strdup (action_name); info->description = g_strdup (action_description); info->keybinding = g_strdup (action_keybinding); @@ -1195,5 +1195,5 @@ _cally_actor_destroy_action_info (gpointer action_info, if (info->notify) info->notify (info->user_data); - g_slice_free (CallyActorActionInfo, info); + g_free (info); } diff --git a/clutter/clutter/clutter-actor-box.c b/clutter/clutter/clutter-actor-box.c index feb9abd59..73f6443d0 100644 --- a/clutter/clutter/clutter-actor-box.c +++ b/clutter/clutter/clutter-actor-box.c @@ -54,7 +54,7 @@ clutter_actor_box_new (gfloat x_1, ClutterActorBox * clutter_actor_box_alloc (void) { - return g_slice_new0 (ClutterActorBox); + return g_new0 (ClutterActorBox, 1); } /** @@ -130,7 +130,7 @@ ClutterActorBox * clutter_actor_box_copy (const ClutterActorBox *box) { if (G_LIKELY (box != NULL)) - return g_slice_dup (ClutterActorBox, box); + return g_memdup2 (box, sizeof (ClutterActorBox)); return NULL; } @@ -148,7 +148,7 @@ void clutter_actor_box_free (ClutterActorBox *box) { if (G_LIKELY (box != NULL)) - g_slice_free (ClutterActorBox, box); + g_free (box); } /** diff --git a/clutter/clutter/clutter-actor.c b/clutter/clutter/clutter-actor.c index 70b2b930b..831402d55 100644 --- a/clutter/clutter/clutter-actor.c +++ b/clutter/clutter/clutter-actor.c @@ -4341,7 +4341,7 @@ static void clutter_transform_info_free (gpointer data) { if (data != NULL) - g_slice_free (ClutterTransformInfo, data); + g_free (data); } /*< private > @@ -4369,7 +4369,7 @@ _clutter_actor_get_transform_info (ClutterActor *self) info = g_object_get_qdata (G_OBJECT (self), quark_actor_transform_info); if (info == NULL) { - info = g_slice_new (ClutterTransformInfo); + info = g_new0 (ClutterTransformInfo, 1); *info = *get_default_transform_info (); @@ -12791,7 +12791,7 @@ clutter_actor_parse_custom_node (ClutterScriptable *scriptable, { RotationInfo *info; - info = g_slice_new0 (RotationInfo); + info = g_new0 (RotationInfo, 1); retval = parse_rotation (actor, node, info); if (retval) @@ -12800,7 +12800,7 @@ clutter_actor_parse_custom_node (ClutterScriptable *scriptable, g_value_set_pointer (value, info); } else - g_slice_free (RotationInfo, info); + g_free (info); } else if (strcmp (name, "actions") == 0 || strcmp (name, "constraints") == 0 || @@ -12863,7 +12863,7 @@ clutter_actor_set_custom_property (ClutterScriptable *scriptable, clutter_actor_set_rotation_angle (actor, info->axis, info->angle); - g_slice_free (RotationInfo, info); + g_free (info); return; } @@ -16429,7 +16429,7 @@ static void layout_info_free (gpointer data) { if (G_LIKELY (data != NULL)) - g_slice_free (ClutterLayoutInfo, data); + g_free (data); } /*< private > @@ -16472,7 +16472,7 @@ _clutter_actor_get_layout_info (ClutterActor *self) retval = _clutter_actor_peek_layout_info (self); if (retval == NULL) { - retval = g_slice_new (ClutterLayoutInfo); + retval = g_new0 (ClutterLayoutInfo, 1); *retval = default_layout_info; @@ -17316,7 +17316,7 @@ clutter_animation_info_free (gpointer data) if (info->states != NULL) g_array_unref (info->states); - g_slice_free (ClutterAnimationInfo, info); + g_free (info); } } @@ -17342,7 +17342,7 @@ _clutter_actor_get_animation_info (ClutterActor *self) res = g_object_get_qdata (obj, quark_actor_animation_info); if (res == NULL) { - res = g_slice_new (ClutterAnimationInfo); + res = g_new0 (ClutterAnimationInfo, 1); *res = default_animation_info; @@ -17380,7 +17380,7 @@ transition_closure_free (gpointer data) g_free (clos->name); - g_slice_free (TransitionClosure, clos); + g_free (clos); } } @@ -17471,7 +17471,7 @@ clutter_actor_add_transition_internal (ClutterActor *self, timeline = CLUTTER_TIMELINE (transition); - clos = g_slice_new (TransitionClosure); + clos = g_new0 (TransitionClosure, 1); clos->actor = self; clos->transition = g_object_ref (transition); clos->name = g_strdup (name); @@ -19310,7 +19310,7 @@ bind_closure_free (gpointer data_) return; g_array_unref (data->props); - g_slice_free (BindClosure, data); + g_free (data); } static ClutterActor * @@ -19401,7 +19401,7 @@ clutter_actor_bind_model_with_properties (ClutterActor *self, g_return_if_fail (G_IS_LIST_MODEL (model)); g_return_if_fail (g_type_is_a (child_type, CLUTTER_TYPE_ACTOR)); - clos = g_slice_new0 (BindClosure); + clos = g_new0 (BindClosure, 1); clos->child_type = child_type; clos->props = g_array_new (FALSE, FALSE, sizeof (BindProperty)); diff --git a/clutter/clutter/clutter-base-types.c b/clutter/clutter/clutter-base-types.c index 9825ba1f2..bf8213812 100644 --- a/clutter/clutter/clutter-base-types.c +++ b/clutter/clutter/clutter-base-types.c @@ -59,7 +59,7 @@ ClutterMargin * clutter_margin_new (void) { - return g_slice_new0 (ClutterMargin); + return g_new0 (ClutterMargin, 1); } /** @@ -77,7 +77,7 @@ ClutterMargin * clutter_margin_copy (const ClutterMargin *margin_) { if (G_LIKELY (margin_ != NULL)) - return g_slice_dup (ClutterMargin, margin_); + return g_memdup2 (margin_, sizeof (ClutterMargin)); return NULL; } @@ -95,7 +95,7 @@ void clutter_margin_free (ClutterMargin *margin_) { if (G_LIKELY (margin_ != NULL)) - g_slice_free (ClutterMargin, margin_); + g_free (margin_); } G_DEFINE_BOXED_TYPE (ClutterMargin, clutter_margin, diff --git a/clutter/clutter/clutter-bezier.c b/clutter/clutter/clutter-bezier.c index 378dfd123..84a10cb67 100644 --- a/clutter/clutter/clutter-bezier.c +++ b/clutter/clutter/clutter-bezier.c @@ -104,7 +104,7 @@ struct _ClutterBezier ClutterBezier * _clutter_bezier_new (void) { - return g_slice_new0 (ClutterBezier); + return g_new0 (ClutterBezier, 1); } void @@ -112,7 +112,7 @@ _clutter_bezier_free (ClutterBezier * b) { if (G_LIKELY (b)) { - g_slice_free (ClutterBezier, b); + g_free (b); } } diff --git a/clutter/clutter/clutter-binding-pool.c b/clutter/clutter/clutter-binding-pool.c index 60144baf9..347ad6d7c 100644 --- a/clutter/clutter/clutter-binding-pool.c +++ b/clutter/clutter/clutter-binding-pool.c @@ -189,7 +189,7 @@ binding_entry_new (const gchar *name, modifiers = modifiers & BINDING_MOD_MASK; - entry = g_slice_new (ClutterBindingEntry); + entry = g_new0 (ClutterBindingEntry, 1); entry->key_val = key_val; entry->modifiers = modifiers; entry->name = (gchar *) g_intern_string (name); @@ -221,7 +221,7 @@ binding_entry_free (gpointer data) g_closure_unref (entry->closure); - g_slice_free (ClutterBindingEntry, entry); + g_free (entry); } } diff --git a/clutter/clutter/clutter-color.c b/clutter/clutter/clutter-color.c index 5fc69beff..ddd41a253 100644 --- a/clutter/clutter/clutter-color.c +++ b/clutter/clutter/clutter-color.c @@ -911,7 +911,7 @@ ClutterColor * clutter_color_copy (const ClutterColor *color) { if (G_LIKELY (color != NULL)) - return g_slice_dup (ClutterColor, color); + return g_memdup2 (color, sizeof (ClutterColor)); return NULL; } @@ -928,7 +928,7 @@ void clutter_color_free (ClutterColor *color) { if (G_LIKELY (color != NULL)) - g_slice_free (ClutterColor, color); + g_free (color); } /** @@ -977,7 +977,7 @@ clutter_color_new (guint8 red, ClutterColor * clutter_color_alloc (void) { - return g_slice_new0 (ClutterColor); + return g_new0 (ClutterColor, 1); } /** diff --git a/clutter/clutter/clutter-event.c b/clutter/clutter/clutter-event.c index c0438a5d4..d454b2ae5 100644 --- a/clutter/clutter/clutter-event.c +++ b/clutter/clutter/clutter-event.c @@ -1269,7 +1269,7 @@ clutter_event_new (ClutterEventType type) ClutterEvent *new_event; ClutterEventPrivate *priv; - priv = g_slice_new0 (ClutterEventPrivate); + priv = g_new0 (ClutterEventPrivate, 1); new_event = (ClutterEvent *) priv; new_event->type = new_event->any.type = type; @@ -1415,7 +1415,7 @@ clutter_event_free (ClutterEvent *event) break; } - g_slice_free (ClutterEventPrivate, (ClutterEventPrivate *) event); + g_free ((ClutterEventPrivate *) event); } } @@ -1830,7 +1830,7 @@ clutter_event_add_filter (ClutterStage *stage, gpointer user_data) { ClutterMainContext *context = _clutter_context_get_default (); - ClutterEventFilter *event_filter = g_slice_new (ClutterEventFilter); + ClutterEventFilter *event_filter = g_new0 (ClutterEventFilter, 1); static guint event_filter_id = 0; event_filter->stage = stage; @@ -1871,7 +1871,7 @@ clutter_event_remove_filter (guint id) event_filter->notify (event_filter->user_data); context->event_filters = g_list_delete_link (context->event_filters, l); - g_slice_free (ClutterEventFilter, event_filter); + g_free (event_filter); return; } } diff --git a/clutter/clutter/clutter-id-pool.c b/clutter/clutter/clutter-id-pool.c index 39fe00231..c71729443 100644 --- a/clutter/clutter/clutter-id-pool.c +++ b/clutter/clutter/clutter-id-pool.c @@ -44,7 +44,7 @@ _clutter_id_pool_new (guint initial_size) { ClutterIDPool *self; - self = g_slice_new (ClutterIDPool); + self = g_new0 (ClutterIDPool, 1); self->array = g_array_sized_new (FALSE, FALSE, sizeof (gpointer), initial_size); @@ -59,7 +59,7 @@ _clutter_id_pool_free (ClutterIDPool *id_pool) g_array_free (id_pool->array, TRUE); g_slist_free (id_pool->free_ids); - g_slice_free (ClutterIDPool, id_pool); + g_free (id_pool); } guint32 diff --git a/clutter/clutter/clutter-main.c b/clutter/clutter/clutter-main.c index 877deeca8..282312bc0 100644 --- a/clutter/clutter/clutter-main.c +++ b/clutter/clutter/clutter-main.c @@ -263,7 +263,7 @@ _clutter_threads_dispatch_free (gpointer data) if (dispatch->notify) dispatch->notify (dispatch->data); - g_slice_free (ClutterThreadsDispatch, dispatch); + g_free (dispatch); } /** @@ -363,7 +363,7 @@ clutter_threads_add_idle_full (gint priority, g_return_val_if_fail (func != NULL, 0); - dispatch = g_slice_new (ClutterThreadsDispatch); + dispatch = g_new0 (ClutterThreadsDispatch, 1); dispatch->func = func; dispatch->data = data; dispatch->notify = notify; @@ -434,7 +434,7 @@ clutter_threads_add_timeout_full (gint priority, g_return_val_if_fail (func != NULL, 0); - dispatch = g_slice_new (ClutterThreadsDispatch); + dispatch = g_new0 (ClutterThreadsDispatch, 1); dispatch->func = func; dispatch->data = data; dispatch->notify = notify; @@ -2007,7 +2007,7 @@ clutter_threads_remove_repaint_func (guint handle_id) if (repaint_func->notify) repaint_func->notify (repaint_func->data); - g_slice_free (ClutterRepaintFunction, repaint_func); + g_free (repaint_func); break; } @@ -2114,7 +2114,7 @@ clutter_threads_add_repaint_func_full (ClutterRepaintFlags flags, context = _clutter_context_get_default (); - repaint_func = g_slice_new (ClutterRepaintFunction); + repaint_func = g_new0 (ClutterRepaintFunction, 1); repaint_func->id = context->last_repaint_id++; @@ -2178,7 +2178,7 @@ _clutter_run_repaint_functions (ClutterRepaintFlags flags) if (repaint_func->notify != NULL) repaint_func->notify (repaint_func->data); - g_slice_free (ClutterRepaintFunction, repaint_func); + g_free (repaint_func); } } diff --git a/clutter/clutter/clutter-paint-volume-private.h b/clutter/clutter/clutter-paint-volume-private.h index 0a52b60c4..a54218460 100644 --- a/clutter/clutter/clutter-paint-volume-private.h +++ b/clutter/clutter/clutter-paint-volume-private.h @@ -62,7 +62,7 @@ struct _ClutterPaintVolume /* As an optimization for internally managed PaintVolumes we allow * initializing ClutterPaintVolume variables allocated on the stack - * so we can avoid hammering the slice allocator. */ + * so we can avoid hammering the memory allocator. */ guint is_static:1; /* A newly initialized PaintVolume is considered empty as it is diff --git a/clutter/clutter/clutter-paint-volume.c b/clutter/clutter/clutter-paint-volume.c index a55c5a8e4..c18e66165 100644 --- a/clutter/clutter/clutter-paint-volume.c +++ b/clutter/clutter/clutter-paint-volume.c @@ -59,7 +59,7 @@ _clutter_paint_volume_new (ClutterActor *actor) g_return_val_if_fail (actor != NULL, NULL); - pv = g_slice_new (ClutterPaintVolume); + pv = g_new0 (ClutterPaintVolume, 1); pv->actor = actor; @@ -78,7 +78,7 @@ _clutter_paint_volume_new (ClutterActor *actor) * traversal of a Clutter scene graph and since paint volumes often * have a very short life cycle that maps well to stack allocation we * allow initializing a static ClutterPaintVolume variable to avoid - * hammering the slice allocator. + * hammering the memory allocator. * * We were seeing slice allocation take about 1% cumulative CPU time * for some very simple clutter tests which although it isn't a *lot* @@ -133,7 +133,7 @@ clutter_paint_volume_copy (const ClutterPaintVolume *pv) g_return_val_if_fail (pv != NULL, NULL); - copy = g_slice_dup (ClutterPaintVolume, pv); + copy = g_memdup2 (pv, sizeof (ClutterPaintVolume)); copy->is_static = FALSE; return copy; @@ -164,7 +164,7 @@ clutter_paint_volume_free (ClutterPaintVolume *pv) if (G_LIKELY (pv->is_static)) return; - g_slice_free (ClutterPaintVolume, pv); + g_free (pv); } /** diff --git a/clutter/clutter/clutter-path.c b/clutter/clutter/clutter-path.c index 49c440203..fba788df2 100644 --- a/clutter/clutter/clutter-path.c +++ b/clutter/clutter/clutter-path.c @@ -1446,7 +1446,7 @@ clutter_path_get_length (ClutterPath *path) static ClutterPathNodeFull * clutter_path_node_full_new (void) { - return g_slice_new0 (ClutterPathNodeFull); + return g_new0 (ClutterPathNodeFull, 1); } static void @@ -1455,7 +1455,7 @@ clutter_path_node_full_free (ClutterPathNodeFull *node) if (node->bezier) _clutter_bezier_free (node->bezier); - g_slice_free (ClutterPathNodeFull, node); + g_free (node); } /** @@ -1471,7 +1471,7 @@ clutter_path_node_full_free (ClutterPathNodeFull *node) ClutterPathNode * clutter_path_node_copy (const ClutterPathNode *node) { - return g_slice_dup (ClutterPathNode, node); + return g_memdup2 (node, sizeof (ClutterPathNode)); } /** @@ -1486,7 +1486,7 @@ void clutter_path_node_free (ClutterPathNode *node) { if (G_LIKELY (node)) - g_slice_free (ClutterPathNode, node); + g_free (node); } /** @@ -1550,7 +1550,7 @@ clutter_knot_copy (const ClutterKnot *knot) if (G_UNLIKELY (knot == NULL)) return NULL; - return g_slice_dup (ClutterKnot, knot); + return g_memdup2 (knot, sizeof (ClutterKnot)); } /** @@ -1565,7 +1565,7 @@ void clutter_knot_free (ClutterKnot *knot) { if (G_LIKELY (knot != NULL)) - g_slice_free (ClutterKnot, knot); + g_free (knot); } /** diff --git a/clutter/clutter/clutter-script-parser.c b/clutter/clutter/clutter-script-parser.c index e1165fd72..8ae38a505 100644 --- a/clutter/clutter/clutter-script-parser.c +++ b/clutter/clutter/clutter-script-parser.c @@ -733,7 +733,7 @@ parse_signals (ClutterScript *script, state != NULL ? state : "", target, warp_to ? "true" : "false"); - sinfo = g_slice_new0 (SignalInfo); + sinfo = g_new0 (SignalInfo, 1); sinfo->is_handler = FALSE; sinfo->name = g_strdup (name); sinfo->state = g_strdup (state); @@ -780,7 +780,7 @@ parse_signals (ClutterScript *script, name, handler, connect, flags); - sinfo = g_slice_new0 (SignalInfo); + sinfo = g_new0 (SignalInfo, 1); sinfo->is_handler = TRUE; sinfo->name = g_strdup (name); sinfo->handler = g_strdup (handler); @@ -852,7 +852,7 @@ clutter_script_parser_object_end (JsonParser *json_parser, { const gchar *class_name; - oinfo = g_slice_new0 (ObjectInfo); + oinfo = g_new0 (ObjectInfo, 1); oinfo->merge_id = _clutter_script_get_last_merge_id (script); oinfo->id = g_strdup (id_); oinfo->has_unresolved = TRUE; @@ -938,7 +938,7 @@ clutter_script_parser_object_end (JsonParser *json_parser, continue; } - pinfo = g_slice_new (PropertyInfo); + pinfo = g_new0 (PropertyInfo, 1); pinfo->name = g_strdup (name); pinfo->node = json_node_copy (node); diff --git a/clutter/clutter/clutter-script.c b/clutter/clutter/clutter-script.c index 96133e79a..e9d4d545e 100644 --- a/clutter/clutter/clutter-script.c +++ b/clutter/clutter/clutter-script.c @@ -203,7 +203,7 @@ property_info_free (gpointer data) g_free (pinfo->name); - g_slice_free (PropertyInfo, pinfo); + g_free (pinfo); } } @@ -219,7 +219,7 @@ signal_info_free (gpointer data) g_free (sinfo->object); g_free (sinfo->target); - g_slice_free (SignalInfo, sinfo); + g_free (sinfo); } } @@ -258,7 +258,7 @@ object_info_free (gpointer data) oinfo->object = NULL; } - g_slice_free (ObjectInfo, oinfo); + g_free (oinfo); } } diff --git a/clutter/clutter/clutter-shader-effect.c b/clutter/clutter/clutter-shader-effect.c index 7bbc97d0d..4c9c866c9 100644 --- a/clutter/clutter/clutter-shader-effect.c +++ b/clutter/clutter/clutter-shader-effect.c @@ -567,7 +567,7 @@ shader_uniform_free (gpointer data) g_value_unset (&uniform->value); g_free (uniform->name); - g_slice_free (ShaderUniform, uniform); + g_free (uniform); } } @@ -577,7 +577,7 @@ shader_uniform_new (const gchar *name, { ShaderUniform *retval; - retval = g_slice_new0 (ShaderUniform); + retval = g_new0 (ShaderUniform, 1); retval->name = g_strdup (name); retval->type = G_VALUE_TYPE (value); retval->location = -1; diff --git a/clutter/clutter/clutter-shader-types.c b/clutter/clutter/clutter-shader-types.c index 6a1b3e504..cdd78003d 100644 --- a/clutter/clutter/clutter-shader-types.c +++ b/clutter/clutter/clutter-shader-types.c @@ -106,13 +106,13 @@ clutter_value_peek_pointer (const GValue *value) static void clutter_value_init_shader_float (GValue *value) { - value->data[0].v_pointer = g_slice_new0 (ClutterShaderFloat); + value->data[0].v_pointer = g_new0 (ClutterShaderFloat, 1); } static void clutter_value_free_shader_float (GValue *value) { - g_slice_free (ClutterShaderFloat, value->data[0].v_pointer); + g_free (value->data[0].v_pointer); } static void @@ -120,7 +120,7 @@ clutter_value_copy_shader_float (const GValue *src, GValue *dest) { dest->data[0].v_pointer = - g_slice_dup (ClutterShaderFloat, src->data[0].v_pointer); + g_memdup2 (src->data[0].v_pointer, sizeof (ClutterShaderFloat)); } static gchar * @@ -198,13 +198,13 @@ clutter_shader_float_get_type (void) static void clutter_value_init_shader_int (GValue *value) { - value->data[0].v_pointer = g_slice_new0 (ClutterShaderInt); + value->data[0].v_pointer = g_new0 (ClutterShaderInt, 1); } static void clutter_value_free_shader_int (GValue *value) { - g_slice_free (ClutterShaderInt, value->data[0].v_pointer); + g_free (value->data[0].v_pointer); } static void @@ -212,7 +212,7 @@ clutter_value_copy_shader_int (const GValue *src, GValue *dest) { dest->data[0].v_pointer = - g_slice_dup (ClutterShaderInt, src->data[0].v_pointer); + g_memdup2 (src->data[0].v_pointer, sizeof (ClutterShaderInt)); } static gchar * @@ -289,13 +289,13 @@ clutter_shader_int_get_type (void) static void clutter_value_init_shader_matrix (GValue *value) { - value->data[0].v_pointer = g_slice_new0 (ClutterShaderMatrix); + value->data[0].v_pointer = g_new0 (ClutterShaderMatrix, 1); } static void clutter_value_free_shader_matrix (GValue *value) { - g_slice_free (ClutterShaderMatrix, value->data[0].v_pointer); + g_free (value->data[0].v_pointer); } static void @@ -303,7 +303,7 @@ clutter_value_copy_shader_matrix (const GValue *src, GValue *dest) { dest->data[0].v_pointer = - g_slice_dup (ClutterShaderMatrix, src->data[0].v_pointer); + g_memdup2 (src->data[0].v_pointer, sizeof (ClutterShaderMatrix)); } static gchar * diff --git a/clutter/clutter/clutter-stage.c b/clutter/clutter/clutter-stage.c index e2630ff09..6e46187c5 100644 --- a/clutter/clutter/clutter-stage.c +++ b/clutter/clutter/clutter-stage.c @@ -2118,7 +2118,7 @@ static gpointer clutter_perspective_copy (gpointer data) { if (G_LIKELY (data)) - return g_slice_dup (ClutterPerspective, data); + return g_memdup2 (data, sizeof (ClutterPerspective)); return NULL; } @@ -2127,7 +2127,7 @@ static void clutter_perspective_free (gpointer data) { if (G_LIKELY (data)) - g_slice_free (ClutterPerspective, data); + g_free (data); } G_DEFINE_BOXED_TYPE (ClutterPerspective, clutter_perspective, @@ -2702,7 +2702,7 @@ clutter_stage_queue_actor_redraw (ClutterStage *stage, } else { - entry = g_slice_new (QueueRedrawEntry); + entry = g_new0 (QueueRedrawEntry, 1); if (clip) { @@ -2723,7 +2723,7 @@ free_queue_redraw_entry (QueueRedrawEntry *entry) { if (entry->has_clip) clutter_paint_volume_free (&entry->clip); - g_slice_free (QueueRedrawEntry, entry); + g_free (entry); } void diff --git a/clutter/clutter/clutter-timeline.c b/clutter/clutter/clutter-timeline.c index 463765686..0c9fd2c1c 100644 --- a/clutter/clutter/clutter-timeline.c +++ b/clutter/clutter/clutter-timeline.c @@ -225,7 +225,7 @@ static TimelineMarker * timeline_marker_new_time (const gchar *name, guint msecs) { - TimelineMarker *marker = g_slice_new (TimelineMarker); + TimelineMarker *marker = g_new0 (TimelineMarker, 1); marker->name = g_strdup (name); marker->quark = g_quark_from_string (marker->name); @@ -239,7 +239,7 @@ static TimelineMarker * timeline_marker_new_progress (const gchar *name, gdouble progress) { - TimelineMarker *marker = g_slice_new (TimelineMarker); + TimelineMarker *marker = g_new0 (TimelineMarker, 1); marker->name = g_strdup (name); marker->quark = g_quark_from_string (marker->name); @@ -257,7 +257,7 @@ timeline_marker_free (gpointer data) TimelineMarker *marker = data; g_free (marker->name); - g_slice_free (TimelineMarker, marker); + g_free (marker); } } diff --git a/clutter/clutter/clutter-units.c b/clutter/clutter/clutter-units.c index 447e55d42..a5f582471 100644 --- a/clutter/clutter/clutter-units.c +++ b/clutter/clutter/clutter-units.c @@ -350,7 +350,7 @@ ClutterUnits * clutter_units_copy (const ClutterUnits *units) { if (units != NULL) - return g_slice_dup (ClutterUnits, units); + return g_memdup2 (units, sizeof (ClutterUnits)); return NULL; } @@ -370,7 +370,7 @@ void clutter_units_free (ClutterUnits *units) { if (units != NULL) - g_slice_free (ClutterUnits, units); + g_free (units); } /** diff --git a/clutter/clutter/clutter-util.c b/clutter/clutter/clutter-util.c index 5f7fab0e1..a5de007f3 100644 --- a/clutter/clutter/clutter-util.c +++ b/clutter/clutter/clutter-util.c @@ -293,7 +293,7 @@ out: static void progress_data_destroy (gpointer data_) { - g_slice_free (ProgressData, data_); + g_free (data_); } /** @@ -365,14 +365,14 @@ clutter_interval_register_progress_func (GType value_type, if (func == NULL) { g_hash_table_remove (progress_funcs, type_name); - g_slice_free (ProgressData, progress_func); + g_free (progress_func); } else progress_func->func = func; } else { - progress_func = g_slice_new (ProgressData); + progress_func = g_new0 (ProgressData, 1); progress_func->value_type = value_type; progress_func->func = func;