From 63a20eb03c0c363cf5271eb3a2fa0bb7552c01be Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Mon, 8 Feb 2021 12:39:01 +0000 Subject: 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 --- malloc/arena.c | 1 - 1 file changed, 1 deletion(-) (limited to 'malloc/arena.c') diff --git a/malloc/arena.c b/malloc/arena.c index 1e83bb66bd..9fbbb38a15 100644 --- a/malloc/arena.c +++ b/malloc/arena.c @@ -306,7 +306,6 @@ ptmalloc_init (void) mtag_enabled = true; mtag_mmap_flags = __MTAG_MMAP_FLAGS; - mtag_granule_mask = ~(size_t)(__MTAG_GRANULE_SIZE - 1); } #endif -- cgit v1.2.3