From: Karthik Nayak Date: Mon, 05 Feb 2024 15:48:41 GMT Subject: Re: [PATCH v2 2/9] reftable: introduce macros to allocate arrays Message-ID: In-Reply-To: <2dde581a0256e4634ca4a64f313a98204763906a.1706772591.git.ps@pks.im> Patrick Steinhardt writes: > Similar to the preceding commit, let's carry over macros to allocate > arrays with `REFTABLE_ALLOC_ARRAY()` and `REFTABLE_CALLOC_ARRAY()`. This > requires us to change the signature of `reftable_calloc()`, which only > takes a single argument right now and thus puts the burden on the caller > to calculate the final array's size. This is a net improvement though as > it means that we can now provide proper overflow checks when multiplying > the array size with the member size. > > Convert callsites of `reftable_calloc()` to the new signature, using the > new macros where possible. What about converting users of `reftable_malloc()` to use `REFTABLE_ALLOC_ARRAY()`. This means currently `REFTABLE_ALLOC_ARRAY()` is defined and never used in this patch series.