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>
This commit is contained in:

committed by
Ingo Molnar

parent
b32d133aec
commit
364794845c
@@ -127,11 +127,11 @@ int bench_mem_memcpy(int argc, const char **argv,
|
||||
return 1;
|
||||
}
|
||||
|
||||
dst = calloc(length, sizeof(char));
|
||||
dst = zalloc(length);
|
||||
if (!dst)
|
||||
die("memory allocation failed - maybe length is too large?\n");
|
||||
|
||||
src = calloc(length, sizeof(char));
|
||||
src = zalloc(length);
|
||||
if (!src)
|
||||
die("memory allocation failed - maybe length is too large?\n");
|
||||
|
||||
|
Reference in New Issue
Block a user