Re: [PATCH v2 15/17] midx: use 64-bit multiplication for chunk sizes
From: Chris Torek <hidden>
Date: 2021-02-06 20:36:37
On Fri, Feb 5, 2021 at 12:41 PM Junio C Hamano [off-list ref] wrote:
Chris Torek [off-list ref] writes:quoted
There are (still) systems with 32-bit size_t (but 64-bit off_t / file sizes), so ... probably not. Is size_t ever more than 64 bits these days?Sorry, you lost me. I do not see how it would help to perform the multiplication in uint64_t, when you suspect that size_t is too small, if the final destination of the result of the multiplication is a function argument of type size_t?
No, you and Derrick Stolee are right, I wasn't looking out far enough here (to the actual function). (I was wondering though if there are systems where the valid range for size_t could exceed that for off_t. Are there still systems using 32-bit off_t? Sometimes I think there are too many abstracted types running around here -- how do we know which sizes are big enough? There is always uintmax_t, though, and for unsigned types, ((T)-1) gets you the maximum possible value.) Chris