[PATCH 3/4] libm/stdlib: Realloc when shrinking by 2* or more

Keith Packard keithp@keithp.com
Fri Aug 14 00:48:37 GMT 2020


Corinna Vinschen <vinschen@redhat.com> writes:

> Just as I wrote above.

Done. In reviewing this code further, I've done a bunch more
restructuring to make the code 64-bit clean, removing the 'offset'
mechanism and letting the compiler compute alignment requirements for
us. The diff for that is pretty large though; would there be an interest
in looking at it? I ask because preparing that patch for newlib would
take several hours as it's currently only in picolibc.

https://github.com/keith-packard/picolibc/commit/fd2d18bb5ab442f16789c243648d07b4ec8e2b29

This also uncovers problems when building with newer GCC versions which
"helpfully optimize" common malloc/free operations that cause incorrect
code to be generated in some configurations of the library.

-- 
-keith
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 832 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/newlib/attachments/20200813/f114fc8b/attachment.sig>


More information about the Newlib mailing list