aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/util.h
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2009-11-24 09:05:16 -0500
committerIngo Molnar <mingo@elte.hu>2009-11-24 10:37:02 -0500
commit364794845cbc49e638b83d7ef739524291e1e961 (patch)
treee720975b26d307d6566afb9305c9f6e44290a7da /tools/perf/util/util.h
parentb32d133aec5dc882cf783a293f393bfb3f4379e1 (diff)
perf tools: Introduce zalloc() for the common calloc(1, N) case
This way we type less characters and it looks more like the kzalloc kernel counterpart. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: Frédéric Weisbecker <fweisbec@gmail.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Paul Mackerras <paulus@samba.org> LKML-Reference: <1259071517-3242-3-git-send-email-acme@infradead.org> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'tools/perf/util/util.h')
-rw-r--r--tools/perf/util/util.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/perf/util/util.h b/tools/perf/util/util.h
index e1c623e0c99e..30c5517f2f91 100644
--- a/tools/perf/util/util.h
+++ b/tools/perf/util/util.h
@@ -302,6 +302,11 @@ extern int xdup(int fd);
302extern FILE *xfdopen(int fd, const char *mode); 302extern FILE *xfdopen(int fd, const char *mode);
303extern int xmkstemp(char *template); 303extern int xmkstemp(char *template);
304 304
305static inline void *zalloc(size_t size)
306{
307 return calloc(1, size);
308}
309
305static inline size_t xsize_t(off_t len) 310static inline size_t xsize_t(off_t len)
306{ 311{
307 return (size_t)len; 312 return (size_t)len;