mirror of
https://github.com/checkpoint-restore/criu
synced 2025-08-31 22:35:33 +00:00
util: Add xstrdup helper
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
This commit is contained in:
@@ -159,6 +159,7 @@ int close_safe(int *fd);
|
|||||||
___p; \
|
___p; \
|
||||||
})
|
})
|
||||||
|
|
||||||
|
#define xstrdup(str) __xalloc(strdup, strlen(str) + 1, str)
|
||||||
#define xmalloc(size) __xalloc(malloc, size, size)
|
#define xmalloc(size) __xalloc(malloc, size, size)
|
||||||
#define xzalloc(size) __xalloc(calloc, size, 1, size)
|
#define xzalloc(size) __xalloc(calloc, size, 1, size)
|
||||||
#define xrealloc(p, size) __xalloc(realloc, size, p, size)
|
#define xrealloc(p, size) __xalloc(realloc, size, p, size)
|
||||||
|
Reference in New Issue
Block a user