[PATCH] malloc: Improve checked_request2size
Paul Eggert
eggert@cs.ucla.edu
Fri Jun 6 19:36:33 GMT 2025
On 6/6/25 10:31, Wilco Dijkstra wrote:
> - return 0;
> + return (size_t)PTRDIFF_MAX + 1;
Is there a reason this is (size_t)PTRDIFF_MAX + 1 rather than SIZE_MAX?
If so, please comment why; if not, please change the expression to
SIZE_MAX as that's likely to be a tad more efficient and won't leave the
reader wondering why the code decreases the size request.
More information about the Libc-alpha
mailing list