[glib/th/gdbus-slice-alloc: 5/11] gdbus: use slice allocator for EmitClosedData




commit 49408f0680046cd1ad520de16a13000bf34cdf1d
Author: Thomas Haller <thaller redhat com>
Date:   Sun Mar 28 08:36:12 2021 +0200

    gdbus: use slice allocator for EmitClosedData

 gio/gdbusconnection.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/gio/gdbusconnection.c b/gio/gdbusconnection.c
index 76ecdffaa..b160d9a7a 100644
--- a/gio/gdbusconnection.c
+++ b/gio/gdbusconnection.c
@@ -1363,7 +1363,7 @@ emit_closed_data_free (EmitClosedData *data)
   g_object_unref (data->connection);
   if (data->error != NULL)
     g_error_free (data->error);
-  g_free (data);
+  g_slice_free (EmitClosedData, data);
 }
 
 /* Called in a user thread that has acquired the main context that was
@@ -1398,7 +1398,7 @@ schedule_closed_unlocked (GDBusConnection *connection,
 
   CONNECTION_ENSURE_LOCK (connection);
 
-  data = g_new0 (EmitClosedData, 1);
+  data = g_slice_new (EmitClosedData);
   data->connection = g_object_ref (connection);
   data->remote_peer_vanished = remote_peer_vanished;
   data->error = error != NULL ? g_error_copy (error) : NULL;


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