malloc: Use branches instead of mtag_granule_mask
commit63a20eb03c0c363cf5271eb3a2fa0bb7552c01be
authorSzabolcs Nagy <szabolcs.nagy@arm.com>
Mon, 8 Feb 2021 12:39:01 +0000 (8 12:39 +0000)
committerSzabolcs Nagy <szabolcs.nagy@arm.com>
Fri, 26 Mar 2021 11:03:06 +0000 (26 11:03 +0000)
tree5dd3dc10e1f41c5d2e12f919d916f3b9244293ee
parent9d61722b599a02a6d3caed1d75417a7f5e661693
malloc: Use branches instead of mtag_granule_mask

The branches may be better optimized since mtag_enabled is widely used.

Granule size larger than a chunk header is not supported since then we
cannot have both the chunk header and user area granule aligned.  To
fix that for targets with large granule, the chunk layout has to change.

So code that attempted to handle the granule mask generally was changed.
This simplified CHUNK_AVAILABLE_SIZE and the logic in malloc_usable_size.

Reviewed-by: DJ Delorie <dj@redhat.com>
malloc/arena.c
malloc/malloc.c