mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-02-26 18:10:37 +01:00
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.
(cherry picked from commit dcdbe98406)
This commit is contained in:
parent
9e32b33d05
commit
8f644537a4
1 changed files with 5 additions and 0 deletions
|
|
@ -1500,6 +1500,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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue