oldmalloc: preserve errno across free
authorRich Felker <dalias@aerifal.cx>
Sat, 30 Jan 2021 22:28:08 +0000 (17:28 -0500)
committerRich Felker <dalias@aerifal.cx>
Sat, 30 Jan 2021 22:28:08 +0000 (17:28 -0500)
commit9b77aaca86b53c367f23505c24dd3c02e240efad
tree7922f847a292971a7dbe61f68acd503d9a58a371
parent98b9df994c85dcb6a8a5a9099495dd44c7cf2bce
oldmalloc: preserve errno across free

as an outcome of Austin Group issue #385, future versions of the
standard will require free not to alter the value of errno. save and
restore it individually around the calls to madvise and munmap so that
the cost is not imposed on calls to free that do not result in any
syscall.
src/malloc/oldmalloc/malloc.c