tools lib: Adopt zalloc()/zfree() from tools/perf
Eroding a bit more the tools/perf/util/util.h hodpodge header. Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Link: https://lkml.kernel.org/n/tip-natazosyn9rwjka25tvcnyi0@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
@@ -9,8 +9,6 @@
|
||||
#include <fcntl.h>
|
||||
#include <stdbool.h>
|
||||
#include <stddef.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
#include <linux/compiler.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
@@ -18,13 +16,6 @@
|
||||
void usage(const char *err) __noreturn;
|
||||
void die(const char *err, ...) __noreturn __printf(1, 2);
|
||||
|
||||
static inline void *zalloc(size_t size)
|
||||
{
|
||||
return calloc(1, size);
|
||||
}
|
||||
|
||||
#define zfree(ptr) ({ free(*ptr); *ptr = NULL; })
|
||||
|
||||
struct dirent;
|
||||
struct nsinfo;
|
||||
struct strlist;
|
||||
|
Reference in New Issue
Block a user