about summary refs log tree commit diff
path: root/malloc
diff options
context:
space:
mode:
authorWilco Dijkstra <wdijkstr@arm.com>2022-09-09 14:22:26 +0100
committerWilco Dijkstra <wdijkstr@arm.com>2022-09-09 14:22:26 +0100
commita364a3a7090b82ddd30e9209df2af56e781d51e4 (patch)
tree90412a565deeeb7aef54205159c0422af71771c9 /malloc
parent53b251c9ff03ab59ba58fcddb9dc97c69f25fadc (diff)
downloadglibc-a364a3a7090b82ddd30e9209df2af56e781d51e4.tar.gz
glibc-a364a3a7090b82ddd30e9209df2af56e781d51e4.tar.xz
glibc-a364a3a7090b82ddd30e9209df2af56e781d51e4.zip
Use C11 atomics instead of atomic_decrement(_val)
Replace atomic_decrement and atomic_decrement_val with
atomic_fetch_add_relaxed.

Reviewed-by: DJ Delorie <dj@redhat.com>
Diffstat (limited to 'malloc')
-rw-r--r--malloc/malloc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/malloc/malloc.c b/malloc/malloc.c
index aea4993f1b..bfe1955737 100644
--- a/malloc/malloc.c
+++ b/malloc/malloc.c
@@ -3033,7 +3033,7 @@ munmap_chunk (mchunkptr p)
       || __glibc_unlikely (!powerof2 (mem & (pagesize - 1))))
     malloc_printerr ("munmap_chunk(): invalid pointer");
 
-  atomic_decrement (&mp_.n_mmaps);
+  atomic_fetch_add_relaxed (&mp_.n_mmaps, -1);
   atomic_fetch_add_relaxed (&mp_.mmapped_mem, -total_size);
 
   /* If munmap failed the process virtual memory address space is in a