summary refs log tree commit diff
path: root/malloc
diff options
context:
space:
mode:
authorWilco Dijkstra <wdijkstr@arm.com>2022-09-09 14:11:23 +0100
committerWilco Dijkstra <wdijkstr@arm.com>2022-09-09 14:11:23 +0100
commit53b251c9ff03ab59ba58fcddb9dc97c69f25fadc (patch)
tree7e21c61f63f05596fd73e342b91f04291bfdebde /malloc
parent83859e1115269cf56d21669361d4ddbe2687831c (diff)
downloadglibc-53b251c9ff03ab59ba58fcddb9dc97c69f25fadc.tar.gz
glibc-53b251c9ff03ab59ba58fcddb9dc97c69f25fadc.tar.xz
glibc-53b251c9ff03ab59ba58fcddb9dc97c69f25fadc.zip
Use C11 atomics instead atomic_add(_zero)
Replace atomic_add and atomic_add_zero 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 ecec901b14..aea4993f1b 100644
--- a/malloc/malloc.c
+++ b/malloc/malloc.c
@@ -3034,7 +3034,7 @@ munmap_chunk (mchunkptr p)
     malloc_printerr ("munmap_chunk(): invalid pointer");
 
   atomic_decrement (&mp_.n_mmaps);
-  atomic_add (&mp_.mmapped_mem, -total_size);
+  atomic_fetch_add_relaxed (&mp_.mmapped_mem, -total_size);
 
   /* If munmap failed the process virtual memory address space is in a
      bad shape.  Just leave the block hanging around, the process will