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.
This commit is contained in:
Thomas Haller 2019-07-23 23:25:03 +02:00
parent 9dfc3ff5af
commit dcdbe98406

View file

@ -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