It's a common task to duplicate some memory. Add (x)memdup functions. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
14 lines
311 B
C
14 lines
311 B
C
#ifndef __XFUNCS_H
|
|
#define __XFUNCS_H
|
|
|
|
#include <linux/types.h>
|
|
|
|
void *xmalloc(size_t size);
|
|
void *xrealloc(void *ptr, size_t size);
|
|
void *xzalloc(size_t size);
|
|
char *xstrdup(const char *s);
|
|
void* xmemalign(size_t alignment, size_t bytes);
|
|
void* xmemdup(const void *orig, size_t size);
|
|
|
|
#endif /* __XFUNCS_H */
|