[mutter] src: Stop using GSlice



commit 6eeeffdc680a41057da1ab4d1b75185dd48000db
Author: Robert Mader <robert mader posteo de>
Date:   Mon Oct 19 19:57:57 2020 +0200

    src: 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: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1512>

 src/backends/meta-barrier.c                          |  2 +-
 src/backends/meta-idle-monitor-dbus.c                |  4 ++--
 src/backends/meta-idle-monitor.c                     |  4 ++--
 src/backends/meta-input-settings.c                   |  4 ++--
 src/backends/meta-monitor-config-manager.c           |  8 ++++----
 src/backends/meta-stage.c                            |  4 ++--
 src/backends/native/meta-barrier-native.c            |  2 +-
 src/backends/native/meta-kms.c                       |  4 ++--
 src/backends/native/meta-launcher.c                  |  4 ++--
 src/backends/native/meta-renderer-native.c           |  4 ++--
 src/backends/native/meta-seat-impl.c                 |  4 ++--
 src/backends/x11/meta-barrier-x11.c                  |  2 +-
 src/compositor/meta-later.c                          |  4 ++--
 src/compositor/meta-shadow-factory.c                 | 10 +++++-----
 src/compositor/meta-texture-tower.c                  |  4 ++--
 src/compositor/meta-window-actor-x11.c               |  4 ++--
 src/compositor/meta-window-shape.c                   |  4 ++--
 src/compositor/plugins/default.c                     |  8 ++++----
 src/core/keybindings.c                               | 10 +++++-----
 src/core/meta-gesture-tracker.c                      |  4 ++--
 src/core/stack-tracker.c                             | 10 +++++-----
 src/wayland/meta-wayland-data-device.c               |  4 ++--
 src/wayland/meta-wayland-data-offer-primary-legacy.c |  4 ++--
 src/wayland/meta-wayland-data-offer-primary.c        |  4 ++--
 src/wayland/meta-wayland-data-offer.c                |  4 ++--
 src/wayland/meta-wayland-pointer.c                   |  4 ++--
 src/wayland/meta-wayland-popup.c                     |  8 ++++----
 src/wayland/meta-wayland-region.c                    |  4 ++--
 src/wayland/meta-wayland-subsurface.c                |  6 +++---
 src/wayland/meta-wayland-surface.c                   |  4 ++--
 src/wayland/meta-wayland-tablet-manager.c            |  4 ++--
 src/wayland/meta-wayland-tablet-pad-group.c          |  4 ++--
 src/wayland/meta-wayland-tablet-pad-ring.c           |  4 ++--
 src/wayland/meta-wayland-tablet-pad-strip.c          |  4 ++--
 src/wayland/meta-wayland-tablet-pad.c                |  4 ++--
 src/wayland/meta-wayland-tablet-seat.c               |  4 ++--
 src/wayland/meta-wayland-tablet-tool.c               |  4 ++--
 src/wayland/meta-wayland-tablet.c                    |  4 ++--
 src/wayland/meta-xwayland-dnd.c                      |  4 ++--
 39 files changed, 91 insertions(+), 91 deletions(-)
---
diff --git a/src/backends/meta-barrier.c b/src/backends/meta-barrier.c
index ea2a77c208..d924d0ab37 100644
--- a/src/backends/meta-barrier.c
+++ b/src/backends/meta-barrier.c
@@ -356,7 +356,7 @@ meta_barrier_event_unref (MetaBarrierEvent *event)
   g_return_if_fail (event->ref_count > 0);
 
   if (g_atomic_int_dec_and_test ((volatile int *)&event->ref_count))
-    g_slice_free (MetaBarrierEvent, event);
+    g_free (event);
 }
 
 G_DEFINE_BOXED_TYPE (MetaBarrierEvent,
diff --git a/src/backends/meta-idle-monitor-dbus.c b/src/backends/meta-idle-monitor-dbus.c
index 7c9065b6cc..1ed54b0337 100644
--- a/src/backends/meta-idle-monitor-dbus.c
+++ b/src/backends/meta-idle-monitor-dbus.c
@@ -83,7 +83,7 @@ destroy_dbus_watch (gpointer data)
   g_free (watch->dbus_name);
   g_bus_unwatch_name (watch->name_watcher_id);
 
-  g_slice_free (DBusWatch, watch);
+  g_free (watch);
 }
 
 static void
@@ -120,7 +120,7 @@ make_dbus_watch (MetaDBusIdleMonitor   *skeleton,
 {
   DBusWatch *watch;
 
-  watch = g_slice_new (DBusWatch);
+  watch = g_new0 (DBusWatch, 1);
   watch->dbus_monitor = g_object_ref (skeleton);
   watch->monitor = g_object_ref (monitor);
   watch->dbus_name = g_strdup (g_dbus_method_invocation_get_sender (invocation));
diff --git a/src/backends/meta-idle-monitor.c b/src/backends/meta-idle-monitor.c
index f2c6c75db3..c678271cc0 100644
--- a/src/backends/meta-idle-monitor.c
+++ b/src/backends/meta-idle-monitor.c
@@ -167,7 +167,7 @@ free_watch (gpointer data)
     g_source_destroy (watch->timeout_source);
 
   g_object_unref (monitor);
-  g_slice_free (MetaIdleMonitorWatch, watch);
+  g_free (watch);
 }
 
 static void
@@ -329,7 +329,7 @@ make_watch (MetaIdleMonitor           *monitor,
 {
   MetaIdleMonitorWatch *watch;
 
-  watch = g_slice_new0 (MetaIdleMonitorWatch);
+  watch = g_new0 (MetaIdleMonitorWatch, 1);
 
   watch->monitor = monitor;
   watch->id = get_next_watch_serial ();
diff --git a/src/backends/meta-input-settings.c b/src/backends/meta-input-settings.c
index e1f6ef556e..808e70ba2b 100644
--- a/src/backends/meta-input-settings.c
+++ b/src/backends/meta-input-settings.c
@@ -1448,7 +1448,7 @@ device_mapping_info_free (DeviceMappingInfo *info)
   g_clear_signal_handler (&info->changed_id, info->settings);
   g_object_unref (info->settings);
   g_free (info->group_modes);
-  g_slice_free (DeviceMappingInfo, info);
+  g_free (info);
 }
 
 static gboolean
@@ -1476,7 +1476,7 @@ check_add_mappable_device (MetaInputSettings  *input_settings,
 
   priv = meta_input_settings_get_instance_private (input_settings);
 
-  info = g_slice_new0 (DeviceMappingInfo);
+  info = g_new0 (DeviceMappingInfo, 1);
   info->input_settings = input_settings;
   info->device = device;
   info->settings = settings;
diff --git a/src/backends/meta-monitor-config-manager.c b/src/backends/meta-monitor-config-manager.c
index c37528b203..0253e072ff 100644
--- a/src/backends/meta-monitor-config-manager.c
+++ b/src/backends/meta-monitor-config-manager.c
@@ -252,7 +252,7 @@ assign_monitor_crtc (MetaMonitor         *monitor,
                                     width,
                                     height);
 
-  crtc_assignment = g_slice_new0 (MetaCrtcAssignment);
+  crtc_assignment = g_new0 (MetaCrtcAssignment, 1);
   *crtc_assignment = (MetaCrtcAssignment) {
     .crtc = crtc,
     .mode = crtc_mode,
@@ -280,7 +280,7 @@ assign_monitor_crtc (MetaMonitor         *monitor,
   else
     assign_output_as_presentation = FALSE;
 
-  output_assignment = g_slice_new0 (MetaOutputAssignment);
+  output_assignment = g_new0 (MetaOutputAssignment, 1);
   *output_assignment = (MetaOutputAssignment) {
     .output = output,
     .is_primary = assign_output_as_primary,
@@ -1600,13 +1600,13 @@ static void
 meta_crtc_assignment_free (MetaCrtcAssignment *assignment)
 {
   g_ptr_array_free (assignment->outputs, TRUE);
-  g_slice_free (MetaCrtcAssignment, assignment);
+  g_free (assignment);
 }
 
 static void
 meta_output_assignment_free (MetaOutputAssignment *assignment)
 {
-  g_slice_free (MetaOutputAssignment, assignment);
+  g_free (assignment);
 }
 
 gboolean
diff --git a/src/backends/meta-stage.c b/src/backends/meta-stage.c
index a08f084639..6f8e3feaed 100644
--- a/src/backends/meta-stage.c
+++ b/src/backends/meta-stage.c
@@ -85,7 +85,7 @@ meta_overlay_new (MetaStage *stage)
   CoglContext *ctx = clutter_backend_get_cogl_context (clutter_backend);
   MetaOverlay *overlay;
 
-  overlay = g_slice_new0 (MetaOverlay);
+  overlay = g_new0 (MetaOverlay, 1);
   overlay->stage = stage;
   overlay->pipeline = cogl_pipeline_new (ctx);
 
@@ -98,7 +98,7 @@ meta_overlay_free (MetaOverlay *overlay)
   if (overlay->pipeline)
     cogl_object_unref (overlay->pipeline);
 
-  g_slice_free (MetaOverlay, overlay);
+  g_free (overlay);
 }
 
 static void
diff --git a/src/backends/native/meta-barrier-native.c b/src/backends/native/meta-barrier-native.c
index bc0620ae9d..3c9c1eabef 100644
--- a/src/backends/native/meta-barrier-native.c
+++ b/src/backends/native/meta-barrier-native.c
@@ -395,7 +395,7 @@ emit_barrier_event (MetaBarrierImplNative *self,
                     float                  dx,
                     float                  dy)
 {
-  MetaBarrierEvent *event = g_slice_new0 (MetaBarrierEvent);
+  MetaBarrierEvent *event = g_new0 (MetaBarrierEvent, 1);
   MetaBarrierState old_state = self->state;
 
   switch (self->state)
diff --git a/src/backends/native/meta-kms.c b/src/backends/native/meta-kms.c
index 7b002273e1..ee77975bd4 100644
--- a/src/backends/native/meta-kms.c
+++ b/src/backends/native/meta-kms.c
@@ -334,7 +334,7 @@ meta_kms_callback_data_free (MetaKmsCallbackData *callback_data)
 {
   if (callback_data->user_data_destroy)
     callback_data->user_data_destroy (callback_data->user_data);
-  g_slice_free (MetaKmsCallbackData, callback_data);
+  g_free (callback_data);
 }
 
 static int
@@ -379,7 +379,7 @@ meta_kms_queue_callback (MetaKms         *kms,
 {
   MetaKmsCallbackData *callback_data;
 
-  callback_data = g_slice_new0 (MetaKmsCallbackData);
+  callback_data = g_new0 (MetaKmsCallbackData, 1);
   *callback_data = (MetaKmsCallbackData) {
     .callback = callback,
     .user_data = user_data,
diff --git a/src/backends/native/meta-launcher.c b/src/backends/native/meta-launcher.c
index 6e4537755e..18bc16745a 100644
--- a/src/backends/native/meta-launcher.c
+++ b/src/backends/native/meta-launcher.c
@@ -521,7 +521,7 @@ meta_launcher_new (GError **error)
   if (!seat_proxy)
     goto fail;
 
-  self = g_slice_new0 (MetaLauncher);
+  self = g_new0 (MetaLauncher, 1);
   self->session_proxy = g_object_ref (session_proxy);
   self->seat_proxy = g_object_ref (seat_proxy);
   self->seat_id = g_steal_pointer (&seat_id);
@@ -550,7 +550,7 @@ meta_launcher_free (MetaLauncher *self)
   g_object_unref (self->seat_proxy);
   g_object_unref (self->session_proxy);
   g_hash_table_destroy (self->impl.sysfs_fds);
-  g_slice_free (MetaLauncher, self);
+  g_free (self);
 }
 
 gboolean
diff --git a/src/backends/native/meta-renderer-native.c b/src/backends/native/meta-renderer-native.c
index dfb80b6dac..0bb3eb66a0 100644
--- a/src/backends/native/meta-renderer-native.c
+++ b/src/backends/native/meta-renderer-native.c
@@ -197,7 +197,7 @@ meta_renderer_native_disconnect (CoglRenderer *cogl_renderer)
 {
   CoglRendererEGL *cogl_renderer_egl = cogl_renderer->winsys;
 
-  g_slice_free (CoglRendererEGL, cogl_renderer_egl);
+  g_free (cogl_renderer_egl);
 }
 
 static gboolean
@@ -209,7 +209,7 @@ meta_renderer_native_connect (CoglRenderer *cogl_renderer,
   MetaRendererNative *renderer_native = meta_renderer_native_from_gpu (gpu_kms);
   MetaRendererNativeGpuData *renderer_gpu_data;
 
-  cogl_renderer->winsys = g_slice_new0 (CoglRendererEGL);
+  cogl_renderer->winsys = g_new0 (CoglRendererEGL, 1);
   cogl_renderer_egl = cogl_renderer->winsys;
 
   renderer_gpu_data = meta_renderer_native_get_gpu_data (renderer_native,
diff --git a/src/backends/native/meta-seat-impl.c b/src/backends/native/meta-seat-impl.c
index b2c5e63e5f..b483956fc8 100644
--- a/src/backends/native/meta-seat-impl.c
+++ b/src/backends/native/meta-seat-impl.c
@@ -195,7 +195,7 @@ meta_seat_impl_lookup_touch_state_in_impl (MetaSeatImpl *seat_impl,
 static void
 meta_touch_state_free (MetaTouchState *state)
 {
-  g_slice_free (MetaTouchState, state);
+  g_free (state);
 }
 
 MetaTouchState *
@@ -214,7 +214,7 @@ meta_seat_impl_acquire_touch_state_in_impl (MetaSeatImpl *seat_impl,
   g_assert (!g_hash_table_contains (seat_impl->touch_states,
                                     GINT_TO_POINTER (seat_slot)));
 
-  touch_state = g_slice_new0 (MetaTouchState);
+  touch_state = g_new0 (MetaTouchState, 1);
   *touch_state = (MetaTouchState) {
     .seat_impl = seat_impl,
     .seat_slot = seat_slot,
diff --git a/src/backends/x11/meta-barrier-x11.c b/src/backends/x11/meta-barrier-x11.c
index 4cf58a81a9..998aefb38f 100644
--- a/src/backends/x11/meta-barrier-x11.c
+++ b/src/backends/x11/meta-barrier-x11.c
@@ -136,7 +136,7 @@ static void
 meta_barrier_fire_xevent (MetaBarrier    *barrier,
                           XIBarrierEvent *xevent)
 {
-  MetaBarrierEvent *event = g_slice_new0 (MetaBarrierEvent);
+  MetaBarrierEvent *event = g_new0 (MetaBarrierEvent, 1);
 
   event->ref_count = 1;
   event->event_id = xevent->eventid;
diff --git a/src/compositor/meta-later.c b/src/compositor/meta-later.c
index dff091d759..61fa97f14e 100644
--- a/src/compositor/meta-later.c
+++ b/src/compositor/meta-later.c
@@ -71,7 +71,7 @@ meta_later_unref (MetaLater *later)
           later->destroy_notify = NULL;
         }
 
-      g_slice_free (MetaLater, later);
+      g_free (later);
     }
 }
 
@@ -216,7 +216,7 @@ meta_laters_add (MetaLaters     *laters,
                  GDestroyNotify  notify)
 {
   ClutterStage *stage = meta_compositor_get_stage (laters->compositor);
-  MetaLater *later = g_slice_new0 (MetaLater);
+  MetaLater *later = g_new0 (MetaLater, 1);
 
   later->id = ++laters->last_later_id;
   later->ref_count = 1;
diff --git a/src/compositor/meta-shadow-factory.c b/src/compositor/meta-shadow-factory.c
index 11a2b3553b..d6424d3bee 100644
--- a/src/compositor/meta-shadow-factory.c
+++ b/src/compositor/meta-shadow-factory.c
@@ -176,7 +176,7 @@ meta_shadow_unref (MetaShadow *shadow)
       cogl_object_unref (shadow->texture);
       cogl_object_unref (shadow->pipeline);
 
-      g_slice_free (MetaShadow, shadow);
+      g_free (shadow);
     }
 }
 
@@ -387,7 +387,7 @@ static void
 meta_shadow_class_info_free (MetaShadowClassInfo *class_info)
 {
   g_free ((char *)class_info->name);
-  g_slice_free (MetaShadowClassInfo, class_info);
+  g_free (class_info);
 }
 
 static void
@@ -405,7 +405,7 @@ meta_shadow_factory_init (MetaShadowFactory *factory)
 
   for (i = 0; i < G_N_ELEMENTS (default_shadow_classes); i++)
     {
-      MetaShadowClassInfo *class_info = g_slice_new (MetaShadowClassInfo);
+      MetaShadowClassInfo *class_info = g_new0 (MetaShadowClassInfo, 1);
 
       *class_info = default_shadow_classes[i];
       class_info->name = g_strdup (class_info->name);
@@ -837,7 +837,7 @@ get_shadow_params (MetaShadowFactory *factory,
     {
       if (create)
         {
-          class_info = g_slice_new0 (MetaShadowClassInfo);
+          class_info = g_new0 (MetaShadowClassInfo, 1);
           *class_info = default_shadow_classes[0];
           class_info->name = g_strdup (class_info->name);
 
@@ -954,7 +954,7 @@ meta_shadow_factory_get_shadow (MetaShadowFactory *factory,
         return meta_shadow_ref (shadow);
     }
 
-  shadow = g_slice_new0 (MetaShadow);
+  shadow = g_new0 (MetaShadow, 1);
 
   shadow->ref_count = 1;
   shadow->factory = factory;
diff --git a/src/compositor/meta-texture-tower.c b/src/compositor/meta-texture-tower.c
index 2571c7e3c0..1fc4623e5e 100644
--- a/src/compositor/meta-texture-tower.c
+++ b/src/compositor/meta-texture-tower.c
@@ -77,7 +77,7 @@ meta_texture_tower_new (void)
 {
   MetaTextureTower *tower;
 
-  tower = g_slice_new0 (MetaTextureTower);
+  tower = g_new0 (MetaTextureTower, 1);
 
   return tower;
 }
@@ -98,7 +98,7 @@ meta_texture_tower_free (MetaTextureTower *tower)
 
   meta_texture_tower_set_base_texture (tower, NULL);
 
-  g_slice_free (MetaTextureTower, tower);
+  g_free (tower);
 }
 
 /**
diff --git a/src/compositor/meta-window-actor-x11.c b/src/compositor/meta-window-actor-x11.c
index 676487716a..70a16d0ebb 100644
--- a/src/compositor/meta-window-actor-x11.c
+++ b/src/compositor/meta-window-actor-x11.c
@@ -135,7 +135,7 @@ typedef struct
 static void
 frame_data_free (FrameData *frame)
 {
-  g_slice_free (FrameData, frame);
+  g_free (frame);
 }
 
 static void
@@ -451,7 +451,7 @@ meta_window_actor_x11_queue_frame_drawn (MetaWindowActor *actor,
   if (meta_window_actor_is_destroyed (actor))
     return;
 
-  frame = g_slice_new0 (FrameData);
+  frame = g_new0 (FrameData, 1);
   frame->frame_counter = -1;
   frame->sync_request_serial = window->sync_request_serial;
 
diff --git a/src/compositor/meta-window-shape.c b/src/compositor/meta-window-shape.c
index 1b47675673..3bb6409c4d 100644
--- a/src/compositor/meta-window-shape.c
+++ b/src/compositor/meta-window-shape.c
@@ -51,7 +51,7 @@ meta_window_shape_new (cairo_region_t *region)
   int max_xspan_x2 = -1;
   guint hash;
 
-  shape = g_slice_new0 (MetaWindowShape);
+  shape = g_new0 (MetaWindowShape, 1);
   shape->ref_count = 1;
 
   cairo_region_get_extents (region, &extents);
@@ -176,7 +176,7 @@ meta_window_shape_unref (MetaWindowShape *shape)
   if (shape->ref_count == 0)
     {
       g_free (shape->rectangles);
-      g_slice_free (MetaWindowShape, shape);
+      g_free (shape);
     }
 }
 
diff --git a/src/compositor/plugins/default.c b/src/compositor/plugins/default.c
index 536dd9e00a..1c73174d2f 100644
--- a/src/compositor/plugins/default.c
+++ b/src/compositor/plugins/default.c
@@ -233,7 +233,7 @@ static void
 free_actor_private (gpointer data)
 {
   if (G_LIKELY (data != NULL))
-    g_slice_free (ActorPrivate, data);
+    g_free (data);
 }
 
 static ActorPrivate *
@@ -246,7 +246,7 @@ get_actor_private (MetaWindowActor *actor)
 
   if (G_UNLIKELY (!priv))
     {
-      priv = g_slice_new0 (ActorPrivate);
+      priv = g_new0 (ActorPrivate, 1);
 
       g_object_set_qdata_full (G_OBJECT (actor),
                                actor_data_quark, priv,
@@ -755,7 +755,7 @@ free_display_tile_preview (DisplayTilePreview *preview)
 
   if (G_LIKELY (preview != NULL)) {
     clutter_actor_destroy (preview->actor);
-    g_slice_free (DisplayTilePreview, preview);
+    g_free (preview);
   }
 }
 
@@ -781,7 +781,7 @@ get_display_tile_preview (MetaDisplay *display)
                                 display_tile_preview_data_quark);
   if (!preview)
     {
-      preview = g_slice_new0 (DisplayTilePreview);
+      preview = g_new0 (DisplayTilePreview, 1);
 
       preview->actor = clutter_actor_new ();
       clutter_actor_set_background_color (preview->actor, CLUTTER_COLOR_Blue);
diff --git a/src/core/keybindings.c b/src/core/keybindings.c
index 064b2338ba..a6e16f084e 100644
--- a/src/core/keybindings.c
+++ b/src/core/keybindings.c
@@ -129,13 +129,13 @@ static void
 meta_key_binding_free (MetaKeyBinding *binding)
 {
   resolved_key_combo_reset (&binding->resolved_combo);
-  g_slice_free (MetaKeyBinding, binding);
+  g_free (binding);
 }
 
 static MetaKeyBinding *
 meta_key_binding_copy (MetaKeyBinding *binding)
 {
-  MetaKeyBinding *clone = g_slice_dup (MetaKeyBinding, binding);
+  MetaKeyBinding *clone = g_memdup2 (binding, sizeof (MetaKeyBinding));
   resolved_key_combo_copy (&binding->resolved_combo,
                            &clone->resolved_combo);
   return clone;
@@ -825,7 +825,7 @@ rebuild_binding_table (MetaKeyBindingManager *keys,
             {
               MetaKeyHandler *handler = HANDLER (pref->name);
 
-              b = g_slice_new0 (MetaKeyBinding);
+              b = g_new0 (MetaKeyBinding, 1);
               b->name = pref->name;
               b->handler = handler;
               b->flags = handler->flags;
@@ -848,7 +848,7 @@ rebuild_binding_table (MetaKeyBindingManager *keys,
         {
           MetaKeyHandler *handler = HANDLER ("external-grab");
 
-          b = g_slice_new0 (MetaKeyBinding);
+          b = g_new0 (MetaKeyBinding, 1);
           b->name = grab->name;
           b->handler = handler;
           b->flags = grab->flags;
@@ -1695,7 +1695,7 @@ meta_display_grab_accelerator (MetaDisplay         *display,
 
   g_hash_table_insert (external_grabs, grab->name, grab);
 
-  binding = g_slice_new0 (MetaKeyBinding);
+  binding = g_new0 (MetaKeyBinding, 1);
   binding->name = grab->name;
   binding->handler = HANDLER ("external-grab");
   binding->combo = combo;
diff --git a/src/core/meta-gesture-tracker.c b/src/core/meta-gesture-tracker.c
index 9bade03321..2badf8b823 100644
--- a/src/core/meta-gesture-tracker.c
+++ b/src/core/meta-gesture-tracker.c
@@ -201,7 +201,7 @@ meta_sequence_info_new (MetaGestureTracker *tracker,
   priv = meta_gesture_tracker_get_instance_private (tracker);
   ms = priv->autodeny_timeout;
 
-  info = g_slice_new0 (MetaSequenceInfo);
+  info = g_new0 (MetaSequenceInfo, 1);
   info->tracker = tracker;
   info->sequence = event->touch.sequence;
   info->state = META_SEQUENCE_NONE;
@@ -220,7 +220,7 @@ meta_sequence_info_free (MetaSequenceInfo *info)
   if (info->state == META_SEQUENCE_NONE)
     meta_gesture_tracker_set_sequence_state (info->tracker, info->sequence,
                                              META_SEQUENCE_REJECTED);
-  g_slice_free (MetaSequenceInfo, info);
+  g_free (info);
 }
 
 static gboolean
diff --git a/src/core/stack-tracker.c b/src/core/stack-tracker.c
index 11a1f0707c..fbfef64653 100644
--- a/src/core/stack-tracker.c
+++ b/src/core/stack-tracker.c
@@ -271,7 +271,7 @@ meta_stack_tracker_dump (MetaStackTracker *tracker)
 static void
 meta_stack_op_free (MetaStackOp *op)
 {
-  g_slice_free (MetaStackOp, op);
+  g_free (op);
 }
 
 static int
@@ -647,7 +647,7 @@ meta_stack_tracker_record_add (MetaStackTracker *tracker,
                                guint64           window,
                               gulong            serial)
 {
-  MetaStackOp *op = g_slice_new (MetaStackOp);
+  MetaStackOp *op = g_new0 (MetaStackOp, 1);
 
   op->any.type = STACK_OP_ADD;
   op->any.serial = serial;
@@ -661,7 +661,7 @@ meta_stack_tracker_record_remove (MetaStackTracker *tracker,
                                   guint64           window,
                                  gulong            serial)
 {
-  MetaStackOp *op = g_slice_new (MetaStackOp);
+  MetaStackOp *op = g_new0 (MetaStackOp, 1);
 
   op->any.type = STACK_OP_REMOVE;
   op->any.serial = serial;
@@ -676,7 +676,7 @@ meta_stack_tracker_record_raise_above (MetaStackTracker *tracker,
                                        guint64           sibling,
                                       gulong            serial)
 {
-  MetaStackOp *op = g_slice_new (MetaStackOp);
+  MetaStackOp *op = g_new0 (MetaStackOp, 1);
 
   op->any.type = STACK_OP_RAISE_ABOVE;
   op->any.serial = serial;
@@ -692,7 +692,7 @@ meta_stack_tracker_record_lower_below (MetaStackTracker *tracker,
                                        guint64           sibling,
                                       gulong            serial)
 {
-  MetaStackOp *op = g_slice_new (MetaStackOp);
+  MetaStackOp *op = g_new0 (MetaStackOp, 1);
 
   op->any.type = STACK_OP_LOWER_BELOW;
   op->any.serial = serial;
diff --git a/src/wayland/meta-wayland-data-device.c b/src/wayland/meta-wayland-data-device.c
index 854bdfc808..3e54cfa3c9 100644
--- a/src/wayland/meta-wayland-data-device.c
+++ b/src/wayland/meta-wayland-data-device.c
@@ -385,7 +385,7 @@ data_device_end_drag_grab (MetaWaylandDragGrab *drag_grab)
       meta_display_sync_wayland_input_focus (meta_get_display ());
     }
 
-  g_slice_free (MetaWaylandDragGrab, drag_grab);
+  g_free (drag_grab);
 }
 
 static gboolean
@@ -583,7 +583,7 @@ meta_wayland_data_device_start_drag (MetaWaylandDataDevice                 *data
   ClutterModifierType modifiers;
   MetaSurfaceActor *surface_actor;
 
-  data_device->current_grab = drag_grab = g_slice_new0 (MetaWaylandDragGrab);
+  data_device->current_grab = drag_grab = g_new0 (MetaWaylandDragGrab, 1);
 
   drag_grab->generic.interface = funcs;
   drag_grab->generic.pointer = seat->pointer;
diff --git a/src/wayland/meta-wayland-data-offer-primary-legacy.c 
b/src/wayland/meta-wayland-data-offer-primary-legacy.c
index 5fe9523d3f..0d5a98743a 100644
--- a/src/wayland/meta-wayland-data-offer-primary-legacy.c
+++ b/src/wayland/meta-wayland-data-offer-primary-legacy.c
@@ -118,7 +118,7 @@ destroy_primary_offer (struct wl_resource *resource)
     }
 
   meta_display_sync_wayland_input_focus (meta_get_display ());
-  g_slice_free (MetaWaylandDataOffer, offer);
+  g_free (offer);
 }
 
 MetaWaylandDataOffer *
@@ -126,7 +126,7 @@ meta_wayland_data_offer_primary_legacy_new (struct wl_resource *target)
 {
   MetaWaylandDataOffer *offer;
 
-  offer = g_slice_new0 (MetaWaylandDataOffer);
+  offer = g_new0 (MetaWaylandDataOffer, 1);
   offer->selection_type = META_SELECTION_PRIMARY;
   offer->resource = wl_resource_create (wl_resource_get_client (target),
                                         &gtk_primary_selection_offer_interface,
diff --git a/src/wayland/meta-wayland-data-offer-primary.c b/src/wayland/meta-wayland-data-offer-primary.c
index a2a4dfe80b..a5c8a6d5a0 100644
--- a/src/wayland/meta-wayland-data-offer-primary.c
+++ b/src/wayland/meta-wayland-data-offer-primary.c
@@ -118,7 +118,7 @@ destroy_primary_offer (struct wl_resource *resource)
     }
 
   meta_display_sync_wayland_input_focus (meta_get_display ());
-  g_slice_free (MetaWaylandDataOffer, offer);
+  g_free (offer);
 }
 
 MetaWaylandDataOffer *
@@ -126,7 +126,7 @@ meta_wayland_data_offer_primary_new (struct wl_resource *target)
 {
   MetaWaylandDataOffer *offer;
 
-  offer = g_slice_new0 (MetaWaylandDataOffer);
+  offer = g_new0 (MetaWaylandDataOffer, 1);
   offer->selection_type = META_SELECTION_PRIMARY;
   offer->resource = wl_resource_create (wl_resource_get_client (target),
                                         &zwp_primary_selection_offer_v1_interface,
diff --git a/src/wayland/meta-wayland-data-offer.c b/src/wayland/meta-wayland-data-offer.c
index fa14fae1ae..c686aee6f6 100644
--- a/src/wayland/meta-wayland-data-offer.c
+++ b/src/wayland/meta-wayland-data-offer.c
@@ -229,7 +229,7 @@ destroy_data_offer (struct wl_resource *resource)
     }
 
   meta_display_sync_wayland_input_focus (meta_get_display ());
-  g_slice_free (MetaWaylandDataOffer, offer);
+  g_free (offer);
 }
 
 MetaWaylandDataOffer *
@@ -239,7 +239,7 @@ meta_wayland_data_offer_new (MetaSelectionType      selection_type,
 {
   MetaWaylandDataOffer *offer;
 
-  offer = g_slice_new0 (MetaWaylandDataOffer);
+  offer = g_new0 (MetaWaylandDataOffer, 1);
   offer->selection_type = selection_type;
   offer->resource = wl_resource_create (wl_resource_get_client (target),
                                         &wl_data_offer_interface,
diff --git a/src/wayland/meta-wayland-pointer.c b/src/wayland/meta-wayland-pointer.c
index 7c6071a6f0..dc84293058 100644
--- a/src/wayland/meta-wayland-pointer.c
+++ b/src/wayland/meta-wayland-pointer.c
@@ -99,7 +99,7 @@ meta_wayland_pointer_client_new (void)
 {
   MetaWaylandPointerClient *pointer_client;
 
-  pointer_client = g_slice_new0 (MetaWaylandPointerClient);
+  pointer_client = g_new0 (MetaWaylandPointerClient, 1);
   wl_list_init (&pointer_client->pointer_resources);
   wl_list_init (&pointer_client->swipe_gesture_resources);
   wl_list_init (&pointer_client->pinch_gesture_resources);
@@ -138,7 +138,7 @@ meta_wayland_pointer_client_free (MetaWaylandPointerClient *pointer_client)
       wl_list_init (wl_resource_get_link (resource));
     }
 
-  g_slice_free (MetaWaylandPointerClient, pointer_client);
+  g_free (pointer_client);
 }
 
 static gboolean
diff --git a/src/wayland/meta-wayland-popup.c b/src/wayland/meta-wayland-popup.c
index a4788615b0..23b26cc431 100644
--- a/src/wayland/meta-wayland-popup.c
+++ b/src/wayland/meta-wayland-popup.c
@@ -167,7 +167,7 @@ meta_wayland_popup_grab_create (MetaWaylandPointer      *pointer,
   struct wl_client *client = wl_resource_get_client (surface->resource);
   MetaWaylandPopupGrab *grab;
 
-  grab = g_slice_new0 (MetaWaylandPopupGrab);
+  grab = g_new0 (MetaWaylandPopupGrab, 1);
   grab->generic.interface = &popup_grab_interface;
   grab->generic.pointer = pointer;
   grab->grab_client = client;
@@ -182,7 +182,7 @@ void
 meta_wayland_popup_grab_destroy (MetaWaylandPopupGrab *grab)
 {
   meta_wayland_popup_grab_end (grab);
-  g_slice_free (MetaWaylandPopupGrab, grab);
+  g_free (grab);
 }
 
 static void
@@ -251,7 +251,7 @@ meta_wayland_popup_destroy (MetaWaylandPopup *popup)
   meta_wayland_popup_surface_dismiss (popup->popup_surface);
 
   wl_list_remove (&popup->link);
-  g_slice_free (MetaWaylandPopup, popup);
+  g_free (popup);
 }
 
 void
@@ -297,7 +297,7 @@ meta_wayland_popup_create (MetaWaylandPopupSurface *popup_surface,
   if (grab->grab_client != wl_resource_get_client (surface->resource))
     return NULL;
 
-  popup = g_slice_new0 (MetaWaylandPopup);
+  popup = g_new0 (MetaWaylandPopup, 1);
   popup->grab = grab;
   popup->popup_surface = popup_surface;
 
diff --git a/src/wayland/meta-wayland-region.c b/src/wayland/meta-wayland-region.c
index 761b97c13b..ee4b6950fa 100644
--- a/src/wayland/meta-wayland-region.c
+++ b/src/wayland/meta-wayland-region.c
@@ -79,7 +79,7 @@ wl_region_destructor (struct wl_resource *resource)
   MetaWaylandRegion *region = wl_resource_get_user_data (resource);
 
   cairo_region_destroy (region->region);
-  g_slice_free (MetaWaylandRegion, region);
+  g_free (region);
 }
 
 MetaWaylandRegion *
@@ -88,7 +88,7 @@ meta_wayland_region_create (MetaWaylandCompositor *compositor,
                             struct wl_resource    *compositor_resource,
                             guint32                id)
 {
-  MetaWaylandRegion *region = g_slice_new0 (MetaWaylandRegion);
+  MetaWaylandRegion *region = g_new0 (MetaWaylandRegion, 1);
 
   region->resource = wl_resource_create (client, &wl_region_interface, wl_resource_get_version 
(compositor_resource), id);
   wl_resource_set_implementation (region->resource, &meta_wayland_wl_region_interface, region, 
wl_region_destructor);
diff --git a/src/wayland/meta-wayland-subsurface.c b/src/wayland/meta-wayland-subsurface.c
index 00ccc7fefa..78b23fe649 100644
--- a/src/wayland/meta-wayland-subsurface.c
+++ b/src/wayland/meta-wayland-subsurface.c
@@ -161,7 +161,7 @@ meta_wayland_subsurface_parent_state_applied (MetaWaylandSubsurface *subsurface)
 
           if (!op->sibling)
             {
-              g_slice_free (MetaWaylandSubsurfacePlacementOp, op);
+              g_free (op);
               continue;
             }
 
@@ -188,7 +188,7 @@ meta_wayland_subsurface_parent_state_applied (MetaWaylandSubsurface *subsurface)
             }
 
           wl_list_remove (&op->sibling_destroy_listener.link);
-          g_slice_free (MetaWaylandSubsurfacePlacementOp, op);
+          g_free (op);
         }
 
       g_slist_free (surface->sub.pending_placement_ops);
@@ -434,7 +434,7 @@ queue_subsurface_placement (MetaWaylandSurface             *surface,
                             MetaWaylandSubsurfacePlacement  placement)
 {
   MetaWaylandSubsurfacePlacementOp *op =
-    g_slice_new (MetaWaylandSubsurfacePlacementOp);
+    g_new0 (MetaWaylandSubsurfacePlacementOp, 1);
 
   op->placement = placement;
   op->sibling = sibling;
diff --git a/src/wayland/meta-wayland-surface.c b/src/wayland/meta-wayland-surface.c
index 0f0c55b1c7..66275055fa 100644
--- a/src/wayland/meta-wayland-surface.c
+++ b/src/wayland/meta-wayland-surface.c
@@ -957,7 +957,7 @@ destroy_frame_callback (struct wl_resource *callback_resource)
     wl_resource_get_user_data (callback_resource);
 
   wl_list_remove (&callback->link);
-  g_slice_free (MetaWaylandFrameCallback, callback);
+  g_free (callback);
 }
 
 static void
@@ -973,7 +973,7 @@ wl_surface_frame (struct wl_client *client,
   if (!surface)
     return;
 
-  callback = g_slice_new0 (MetaWaylandFrameCallback);
+  callback = g_new0 (MetaWaylandFrameCallback, 1);
   callback->surface = surface;
   callback->resource = wl_resource_create (client,
                                            &wl_callback_interface,
diff --git a/src/wayland/meta-wayland-tablet-manager.c b/src/wayland/meta-wayland-tablet-manager.c
index 9c81d5afc2..a729c7b894 100644
--- a/src/wayland/meta-wayland-tablet-manager.c
+++ b/src/wayland/meta-wayland-tablet-manager.c
@@ -108,7 +108,7 @@ meta_wayland_tablet_manager_new (MetaWaylandCompositor *compositor)
 {
   MetaWaylandTabletManager *tablet_manager;
 
-  tablet_manager = g_slice_new0 (MetaWaylandTabletManager);
+  tablet_manager = g_new0 (MetaWaylandTabletManager, 1);
   tablet_manager->compositor = compositor;
   tablet_manager->wl_display = compositor->wayland_display;
   tablet_manager->seats = g_hash_table_new_full (NULL, NULL, NULL,
@@ -132,7 +132,7 @@ void
 meta_wayland_tablet_manager_free (MetaWaylandTabletManager *tablet_manager)
 {
   g_hash_table_destroy (tablet_manager->seats);
-  g_slice_free (MetaWaylandTabletManager, tablet_manager);
+  g_free (tablet_manager);
 }
 
 static MetaWaylandTabletSeat *
diff --git a/src/wayland/meta-wayland-tablet-pad-group.c b/src/wayland/meta-wayland-tablet-pad-group.c
index 46d3d21fc5..2816515881 100644
--- a/src/wayland/meta-wayland-tablet-pad-group.c
+++ b/src/wayland/meta-wayland-tablet-pad-group.c
@@ -45,7 +45,7 @@ meta_wayland_tablet_pad_group_new (MetaWaylandTabletPad *pad)
 {
   MetaWaylandTabletPadGroup *group;
 
-  group = g_slice_new0 (MetaWaylandTabletPadGroup);
+  group = g_new0 (MetaWaylandTabletPadGroup, 1);
   wl_list_init (&group->resource_list);
   wl_list_init (&group->focus_resource_list);
   group->pad = pad;
@@ -67,7 +67,7 @@ meta_wayland_tablet_pad_group_free (MetaWaylandTabletPadGroup *group)
   g_list_free (group->rings);
   g_list_free (group->strips);
 
-  g_slice_free (MetaWaylandTabletPadGroup, group);
+  g_free (group);
 }
 
 static void
diff --git a/src/wayland/meta-wayland-tablet-pad-ring.c b/src/wayland/meta-wayland-tablet-pad-ring.c
index a89f5dd94f..55e45eaa22 100644
--- a/src/wayland/meta-wayland-tablet-pad-ring.c
+++ b/src/wayland/meta-wayland-tablet-pad-ring.c
@@ -46,7 +46,7 @@ meta_wayland_tablet_pad_ring_new (MetaWaylandTabletPad *pad)
 {
   MetaWaylandTabletPadRing *ring;
 
-  ring = g_slice_new0 (MetaWaylandTabletPadRing);
+  ring = g_new0 (MetaWaylandTabletPadRing, 1);
   wl_list_init (&ring->resource_list);
   wl_list_init (&ring->focus_resource_list);
   ring->pad = pad;
@@ -66,7 +66,7 @@ meta_wayland_tablet_pad_ring_free (MetaWaylandTabletPadRing *ring)
     }
 
   g_free (ring->feedback);
-  g_slice_free (MetaWaylandTabletPadRing, ring);
+  g_free (ring);
 }
 
 static void
diff --git a/src/wayland/meta-wayland-tablet-pad-strip.c b/src/wayland/meta-wayland-tablet-pad-strip.c
index 6f6c20d8df..b320dbf800 100644
--- a/src/wayland/meta-wayland-tablet-pad-strip.c
+++ b/src/wayland/meta-wayland-tablet-pad-strip.c
@@ -46,7 +46,7 @@ meta_wayland_tablet_pad_strip_new (MetaWaylandTabletPad *pad)
 {
   MetaWaylandTabletPadStrip *strip;
 
-  strip = g_slice_new0 (MetaWaylandTabletPadStrip);
+  strip = g_new0 (MetaWaylandTabletPadStrip, 1);
   wl_list_init (&strip->resource_list);
   wl_list_init (&strip->focus_resource_list);
   strip->pad = pad;
@@ -66,7 +66,7 @@ meta_wayland_tablet_pad_strip_free (MetaWaylandTabletPadStrip *strip)
     }
 
   g_free (strip->feedback);
-  g_slice_free (MetaWaylandTabletPadStrip, strip);
+  g_free (strip);
 }
 
 static void
diff --git a/src/wayland/meta-wayland-tablet-pad.c b/src/wayland/meta-wayland-tablet-pad.c
index 22704aee73..c0b408c101 100644
--- a/src/wayland/meta-wayland-tablet-pad.c
+++ b/src/wayland/meta-wayland-tablet-pad.c
@@ -100,7 +100,7 @@ meta_wayland_tablet_pad_new (ClutterInputDevice    *device,
   MetaWaylandTabletPad *pad;
   guint n_elems, i;
 
-  pad = g_slice_new0 (MetaWaylandTabletPad);
+  pad = g_new0 (MetaWaylandTabletPad, 1);
   wl_list_init (&pad->resource_list);
   wl_list_init (&pad->focus_resource_list);
   pad->focus_surface_listener.notify = pad_handle_focus_surface_destroy;
@@ -168,7 +168,7 @@ meta_wayland_tablet_pad_free (MetaWaylandTabletPad *pad)
 
   g_hash_table_destroy (pad->feedback);
 
-  g_slice_free (MetaWaylandTabletPad, pad);
+  g_free (pad);
 }
 
 static MetaWaylandTabletPadGroup *
diff --git a/src/wayland/meta-wayland-tablet-seat.c b/src/wayland/meta-wayland-tablet-seat.c
index 846c30c035..f9b95a6568 100644
--- a/src/wayland/meta-wayland-tablet-seat.c
+++ b/src/wayland/meta-wayland-tablet-seat.c
@@ -258,7 +258,7 @@ meta_wayland_tablet_seat_new (MetaWaylandTabletManager *manager,
   MetaWaylandTabletSeat *tablet_seat;
   GList *devices, *l;
 
-  tablet_seat = g_slice_new0 (MetaWaylandTabletSeat);
+  tablet_seat = g_new0 (MetaWaylandTabletSeat, 1);
   tablet_seat->manager = manager;
   tablet_seat->seat = seat;
   tablet_seat->clutter_seat = clutter_backend_get_default_seat (clutter_get_default_backend ());
@@ -303,7 +303,7 @@ meta_wayland_tablet_seat_free (MetaWaylandTabletSeat *tablet_seat)
   g_hash_table_destroy (tablet_seat->tablets);
   g_hash_table_destroy (tablet_seat->tools);
   g_hash_table_destroy (tablet_seat->pads);
-  g_slice_free (MetaWaylandTabletSeat, tablet_seat);
+  g_free (tablet_seat);
 }
 
 struct wl_resource *
diff --git a/src/wayland/meta-wayland-tablet-tool.c b/src/wayland/meta-wayland-tablet-tool.c
index 7b4f608040..a8de868bc5 100644
--- a/src/wayland/meta-wayland-tablet-tool.c
+++ b/src/wayland/meta-wayland-tablet-tool.c
@@ -387,7 +387,7 @@ meta_wayland_tablet_tool_new (MetaWaylandTabletSeat  *seat,
 {
   MetaWaylandTabletTool *tool;
 
-  tool = g_slice_new0 (MetaWaylandTabletTool);
+  tool = g_new0 (MetaWaylandTabletTool, 1);
   tool->seat = seat;
   tool->device = device;
   tool->device_tool = device_tool;
@@ -424,7 +424,7 @@ meta_wayland_tablet_tool_free (MetaWaylandTabletTool *tool)
   g_clear_signal_handler (&tool->prepare_at_signal_id, tool->default_sprite);
   g_object_unref (tool->default_sprite);
 
-  g_slice_free (MetaWaylandTabletTool, tool);
+  g_free (tool);
 }
 
 static void
diff --git a/src/wayland/meta-wayland-tablet.c b/src/wayland/meta-wayland-tablet.c
index 763f804b26..bb83bb255b 100644
--- a/src/wayland/meta-wayland-tablet.c
+++ b/src/wayland/meta-wayland-tablet.c
@@ -45,7 +45,7 @@ meta_wayland_tablet_new (ClutterInputDevice    *device,
 {
   MetaWaylandTablet *tablet;
 
-  tablet = g_slice_new0 (MetaWaylandTablet);
+  tablet = g_new0 (MetaWaylandTablet, 1);
   wl_list_init (&tablet->resource_list);
   tablet->device = device;
   tablet->tablet_seat = tablet_seat;
@@ -65,7 +65,7 @@ meta_wayland_tablet_free (MetaWaylandTablet *tablet)
       wl_list_init (wl_resource_get_link (resource));
     }
 
-  g_slice_free (MetaWaylandTablet, tablet);
+  g_free (tablet);
 }
 
 static void
diff --git a/src/wayland/meta-xwayland-dnd.c b/src/wayland/meta-xwayland-dnd.c
index 6c97ffee2e..de61ccf73f 100644
--- a/src/wayland/meta-xwayland-dnd.c
+++ b/src/wayland/meta-xwayland-dnd.c
@@ -952,7 +952,7 @@ meta_xwayland_init_dnd (Display *xdisplay)
 
   g_assert (manager->dnd == NULL);
 
-  manager->dnd = dnd = g_slice_new0 (MetaXWaylandDnd);
+  manager->dnd = dnd = g_new0 (MetaXWaylandDnd, 1);
 
   for (i = 0; i < N_DND_ATOMS; i++)
     xdnd_atoms[i] = gdk_x11_get_xatom_by_name (atom_names[i]);
@@ -987,6 +987,6 @@ meta_xwayland_shutdown_dnd (Display *xdisplay)
   XDestroyWindow (xdisplay, dnd->dnd_window);
   dnd->dnd_window = None;
 
-  g_slice_free (MetaXWaylandDnd, dnd);
+  g_free (dnd);
   manager->dnd = NULL;
 }


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