From bf395e10c52094c44b1a6e0b7fedc35c35de0641 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20G=C3=B6ttsche?= Date: Fri, 10 Sep 2021 15:09:42 +0200 Subject: Add xReallocArrayZero() helper Add helper function to reallocate an dynamic allocated array including zeroing the newly allocated memory. --- XUtils.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'XUtils.h') diff --git a/XUtils.h b/XUtils.h index 8a6ee37e..13f4be4b 100644 --- a/XUtils.h +++ b/XUtils.h @@ -30,6 +30,8 @@ void* xRealloc(void* ptr, size_t size) ATTR_ALLOC_SIZE1(2); void* xReallocArray(void* ptr, size_t nmemb, size_t size) ATTR_ALLOC_SIZE2(2, 3); +void* xReallocArrayZero(void* ptr, size_t prevmemb, size_t newmemb, size_t size) ATTR_ALLOC_SIZE2(3, 4); + /* * String_startsWith gives better performance if strlen(match) can be computed * at compile time (e.g. when they are immutable string literals). :) -- cgit v1.2.3