]> git.ipfire.org Git - thirdparty/git.git/commit - khash.h
khash: clarify that allocations never fail
authorRené Scharfe <l.s.r@web.de>
Sat, 3 Jul 2021 12:57:30 +0000 (14:57 +0200)
committerJunio C Hamano <gitster@pobox.com>
Tue, 6 Jul 2021 20:07:50 +0000 (13:07 -0700)
commit5632e838f8fa73abfce3f66d2781b8e6d7b14001
tree8221b4be27b61e43ea71823c7177e580d60b8a30
parentebf3c04b262aa27fbb97f8a0156c2347fecafafb
khash: clarify that allocations never fail

We use our standard allocation functions and macros (xcalloc,
ALLOC_ARRAY, REALLOC_ARRAY) in our version of khash.h.  They terminate
the program on error instead, so code that's using them doesn't have to
handle allocation failures.  Make this behavior explicit by turning
kh_resize_ into a void function and removing the related unreachable
error handling code.

Helped-by: Jeff King <peff@peff.net>
Signed-off-by: René Scharfe <l.s.r@web.de>
Acked-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
khash.h