[PATCH v2] malloc: Simplify _int_free_chunk

Yury Khrustalev yury.khrustalev@arm.com
Fri Jun 5 13:04:26 GMT 2026


On Tue, Jun 02, 2026 at 03:36:48PM +0000, Wilco Dijkstra wrote:
> v2: rebased
> 
> Simplify _int_free_chunk() and always lock if needed.  Use _int_free_merge_chunk()
> for cases that assume the arena has been locked  instead.  Move the errno save/
> restore to _int_free_maybe_trim().
> 
> Passes regress, OK for commit?

LGTM

Reviewed-by: Yury Khrustalev <yury.khrustalev@arm.com>

The paths that were using '_int_free_chunk (..., chunk, ..., 1)' before
this change were never called for mmap-ed chunks.

Tested on aarch64-linux-gnu, x86_64-pc-linux-gnu, i686-pc-linux-gnu.

Thanks,
Yury



More information about the Libc-alpha mailing list