summaryrefslogtreecommitdiff
path: root/shared
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2019-07-23 23:25:03 +0200
committerThomas Haller <thaller@redhat.com>2019-07-25 15:26:49 +0200
commitdcdbe984065ed06753a0ce542c1aaaa9336d8424 (patch)
treef9ac138bcb572533aea96ed6588764906f16790e /shared
parent9dfc3ff5af44324abe92001d2588dced3372da1b (diff)
downloadNetworkManager-dcdbe984065ed06753a0ce542c1aaaa9336d8424.tar.gz
shared: add nm_g_slice_free() helper
How odd that such a macro does not exist yet. It seems like the majorities of calls to g_slice_free() could be replaced by this.
Diffstat (limited to 'shared')
-rw-r--r--shared/nm-glib-aux/nm-macros-internal.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/shared/nm-glib-aux/nm-macros-internal.h b/shared/nm-glib-aux/nm-macros-internal.h
index 9062fe8d98..9502c442ec 100644
--- a/shared/nm-glib-aux/nm-macros-internal.h
+++ b/shared/nm-glib-aux/nm-macros-internal.h
@@ -1569,6 +1569,11 @@ nm_strcmp_p (gconstpointer a, gconstpointer b)
/*****************************************************************************/
+#define nm_g_slice_free(ptr) \
+ g_slice_free (typeof (*(ptr)), ptr)
+
+/*****************************************************************************/
+
/* like g_memdup(). The difference is that the @size argument is of type
* gsize, while g_memdup() has type guint. Since, the size of container types
* like GArray is guint as well, this means trying to g_memdup() an