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
{
free (result);
- atomic_add (&noai6ai_cached.usecnt, 2);
+ atomic_fetch_add_relaxed (&noai6ai_cached.usecnt, 2);
noai6ai_cached.seen_ipv4 = seen_ipv4;
noai6ai_cached.seen_ipv6 = seen_ipv6;
result = &noai6ai_cached;
*in6ai = data->in6ai;
if (olddata != NULL && olddata->usecnt > 0
- && atomic_add_zero (&olddata->usecnt, -1))
+ && atomic_fetch_add_relaxed (&olddata->usecnt, -1) == 1)
free (olddata);
return;
(struct cached_data *) ((char *) ai
- offsetof (struct cached_data, in6ai));
- if (atomic_add_zero (&data->usecnt, -1))
+ if (atomic_fetch_add_relaxed (&data->usecnt, -1) == 1)
{
__libc_lock_lock (lock);