xvfb: replace xallocarray() by calloc()
Only key difference that calloc(), in contrast to rellocarray(), is zero-initializing. The overhead is hard to measure on today's machines, and it's safer programming practise to always allocate zero-initialized, so one can't forget to do it explicitly. Cocci rule: @@ expression COUNT; expression LEN; @@ - xallocarray(COUNT,LEN) + calloc(COUNT,LEN) Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
parent
5a003a7663
commit
f0257bfe93
|
@ -481,9 +481,9 @@ vfbInstallColormap(ColormapPtr pmap)
|
|||
swapcopy32(pXWDHeader->bits_per_rgb, pVisual->bitsPerRGBValue);
|
||||
swapcopy32(pXWDHeader->colormap_entries, pVisual->ColormapEntries);
|
||||
|
||||
ppix = xallocarray(entries, sizeof(Pixel));
|
||||
prgb = xallocarray(entries, sizeof(xrgb));
|
||||
defs = xallocarray(entries, sizeof(xColorItem));
|
||||
ppix = calloc(entries, sizeof(Pixel));
|
||||
prgb = calloc(entries, sizeof(xrgb));
|
||||
defs = calloc(entries, sizeof(xColorItem));
|
||||
|
||||
for (i = 0; i < entries; i++)
|
||||
ppix[i] = i;
|
||||
|
|
Loading…
Reference in New Issue