[glib/th/gdbus-slice-alloc: 4/11] gdbus: use slice allocator for CallDestroyNotifyData




commit 892a8bb1b90cc85a6e2220d133ece479f606d5d4
Author: Thomas Haller <thaller redhat com>
Date:   Sun Mar 28 08:34:48 2021 +0200

    gdbus: use slice allocator for CallDestroyNotifyData

 gio/gdbusconnection.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/gio/gdbusconnection.c b/gio/gdbusconnection.c
index 2be49e1f7..76ecdffaa 100644
--- a/gio/gdbusconnection.c
+++ b/gio/gdbusconnection.c
@@ -243,7 +243,7 @@ call_destroy_notify_data_in_idle (gpointer user_data)
 static void
 call_destroy_notify_data_free (CallDestroyNotifyData *data)
 {
-  g_free (data);
+  g_slice_free (CallDestroyNotifyData, data);
 }
 
 /*
@@ -265,7 +265,7 @@ call_destroy_notify (GMainContext  *context,
   if (callback == NULL)
     return;
 
-  data = g_new0 (CallDestroyNotifyData, 1);
+  data = g_slice_new (CallDestroyNotifyData);
   data->callback = callback;
   data->user_data = user_data;
 


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