1 /* SPDX-License-Identifier: GPL-2.0-only */
9 static inline void *xmalloc(size_t size
)
11 void *p
= malloc(size
);
18 static inline void *xcalloc(size_t nmemb
, size_t size
)
20 void *p
= calloc(nmemb
, size
);
27 static inline void *xrealloc(void *p
, size_t size
)
35 static inline char *xstrdup(const char *s
)
44 static inline char *xstrndup(const char *s
, size_t n
)
46 char *p
= strndup(s
, n
);