diff options
| author | Wilco Dijkstra <wilco.dijkstra@arm.com> | 2025-09-10 09:07:39 +0000 |
|---|---|---|
| committer | Wilco Dijkstra <wilco.dijkstra@arm.com> | 2025-09-10 09:18:06 +0000 |
| commit | 210ee295033c8fb068529f8f408078c418ceb46c (patch) | |
| tree | 513ebe19e03eccc1b34ed351a6cdd295dba7051d /malloc/malloc.c | |
| parent | 245ea60b0e0f7d7abcc8ab3b693439df5f93fed9 (diff) | |
atomics: Remove unused atomics
Remove all unused atomics. Replace uses of catomic_increment and
catomic_decrement with atomic_fetch_add_relaxed which maps to a standard
compiler builtin. Relaxed memory ordering is correct for simple counters
since they only need atomicity.
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Diffstat (limited to 'malloc/malloc.c')
| -rw-r--r-- | malloc/malloc.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/malloc/malloc.c b/malloc/malloc.c index 18ef6b5cb8..ac90688126 100644 --- a/malloc/malloc.c +++ b/malloc/malloc.c @@ -4008,7 +4008,7 @@ _int_malloc (mstate av, size_t bytes) if (__glibc_unlikely (pp != NULL && misaligned_chunk (pp))) \ malloc_printerr ("malloc(): unaligned fastbin chunk detected"); \ } \ - while ((pp = catomic_compare_and_exchange_val_acq (fb, pp, victim)) \ + while ((pp = atomic_compare_and_exchange_val_acq (fb, pp, victim)) \ != victim); \ if ((unsigned long) (nb) <= (unsigned long) (get_max_fast ())) @@ -4667,7 +4667,7 @@ _int_free_chunk (mstate av, mchunkptr p, INTERNAL_SIZE_T size, int have_lock) old2 = old; p->fd = PROTECT_PTR (&p->fd, old); } - while ((old = catomic_compare_and_exchange_val_rel (fb, p, old2)) + while ((old = atomic_compare_and_exchange_val_rel (fb, p, old2)) != old2); /* Check that size of fastbin chunk at the top is the same as |
