xdiff: introduce xdl_calloc

In preparation for introducing XDL_CALLOC_ARRAY() use calloc() to
obtain zeroed out memory rather than malloc() followed by memset(). To
try and keep the lines a reasonable length this commit also stops
casting the pointer returned by calloc() as this is unnecessary.

Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Phillip Wood
2022-07-08 16:25:17 +00:00
committed by Junio C Hamano
parent abf04bdaa8
commit 18aae7e21e
4 changed files with 15 additions and 24 deletions

View File

@ -120,6 +120,7 @@ typedef struct s_bdiffparam {
#define xdl_malloc(x) xmalloc(x)
#define xdl_calloc(n, sz) xcalloc(n, sz)
#define xdl_free(ptr) free(ptr)
#define xdl_realloc(ptr,x) xrealloc(ptr,x)