diff options
author | Wilco Dijkstra <wilco.dijkstra@arm.com> | 2025-07-10 15:49:14 +0000 |
---|---|---|
committer | Wilco Dijkstra <wilco.dijkstra@arm.com> | 2025-07-29 14:11:58 +0000 |
commit | 089b4fb90fac8ed53039bc4c465c4d333c6b4048 (patch) | |
tree | 1a7643024904e47768b96ceb817b93b488cf8fbe | |
parent | 9716ee567a52e455ac84cd1bb5f1596030cf5103 (diff) | |
download | glibc-089b4fb90fac8ed53039bc4c465c4d333c6b4048.zip glibc-089b4fb90fac8ed53039bc4c465c4d333c6b4048.tar.gz glibc-089b4fb90fac8ed53039bc4c465c4d333c6b4048.tar.bz2 |
malloc: Remove redundant NULL check
Remove a redundant NULL check from tcache_get_n.
Reviewed-by: Cupertino Miranda <cupertino.miranda@oracle.com>
-rw-r--r-- | malloc/malloc.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/malloc/malloc.c b/malloc/malloc.c index 5ca390c..cf5c02f 100644 --- a/malloc/malloc.c +++ b/malloc/malloc.c @@ -3208,11 +3208,10 @@ tcache_get_n (size_t tc_idx, tcache_entry **ep, bool mangled) if (__glibc_unlikely (misaligned_mem (e))) malloc_printerr ("malloc(): unaligned tcache chunk detected"); - void *ne = e == NULL ? NULL : REVEAL_PTR (e->next); if (!mangled) - *ep = ne; + *ep = REVEAL_PTR (e->next); else - *ep = PROTECT_PTR (ep, ne); + *ep = PROTECT_PTR (ep, REVEAL_PTR (e->next)); ++(tcache->num_slots[tc_idx]); e->key = 0; @@ -3229,7 +3228,7 @@ tcache_put (mchunkptr chunk, size_t tc_idx) static __always_inline void * tcache_get (size_t tc_idx) { - return tcache_get_n (tc_idx, & tcache->entries[tc_idx], false); + return tcache_get_n (tc_idx, &tcache->entries[tc_idx], false); } static __always_inline tcache_entry ** |