xdiff: introduce XDL_CALLOC_ARRAY()
commit848fd5ae5b6506df50ae872302d94b794dc57d51
authorPhillip Wood <phillip.wood@dunelm.org.uk>
Fri, 8 Jul 2022 16:25:18 +0000 (8 16:25 +0000)
committerJunio C Hamano <gitster@pobox.com>
Fri, 8 Jul 2022 16:34:30 +0000 (8 09:34 -0700)
treee826df62795df5dd9b55b1f4aa0c38005e7a2294
parent18aae7e21e1a88c75adb38aa2555e0b1928b137d
xdiff: introduce XDL_CALLOC_ARRAY()

Add a helper for allocating an array and initialize the elements to
zero. This is analogous to CALLOC_ARRAY() in the rest of the codebase
but it returns NULL on allocation failures rather than dying to
accommodate other users of libxdiff such as libgit2.

Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
xdiff/xhistogram.c
xdiff/xmacros.h
xdiff/xpatience.c
xdiff/xprepare.c