[PATCH] [BZ 20628] make mallinfo saturating

Paul Eggert eggert@cs.ucla.edu
Tue Sep 27 19:07:00 GMT 2016


It would be more backward-compatible to represent minor overflows as 
negative numbers that are equivalent to the correct answers modulo 
(UINT_MAX + 1). That way, callers can continue to retrieve the correct 
values by casting int to unsigned. The code can use -1 to represent a 
value greater than UINT_MAX. This all should be doable just as 
efficiently as the proposed patch.



More information about the Libc-alpha mailing list