9 extern void *xmalloc(size_t size
) __hidden
;
10 extern void *xcalloc(size_t nmemb
, size_t size
) __hidden
;
11 extern void *xzmalloc(size_t size
) __hidden
;
12 extern void *xmallocz(size_t size
) __hidden
;
13 extern void *xmalloc_aligned(size_t size
, size_t alignment
) __hidden
;
14 extern void *xzmalloc_aligned(size_t size
, size_t alignment
) __hidden
;
15 extern void *xmemdupz(const void *data
, size_t len
) __hidden
;
16 extern void *xrealloc(void *ptr
, size_t nmemb
, size_t size
) __hidden
;
17 extern void xfree_func(void *ptr
) __hidden
;
18 extern char *xstrdup(const char *str
) __hidden
;
19 extern char *xstrndup(const char *str
, size_t size
) __hidden
;
21 static inline void __xfree(void *ptr
)
23 if (unlikely((ptr
) == NULL
))
24 panic("xfree: NULL pointer given as argument\n");
28 #define xzfree(ptr, size) \
30 xmemset(ptr, 0, size); \
40 #endif /* XMALLOC_H */