* The following bugs are resolved with this release:
- 156, 431, 832, 2801, 9954, 10278, 13028, 13982, 13985, 14029, 14155,
- 14547, 14699, 14876, 14910, 15048, 15218, 15277, 15308, 15362, 15400,
- 15427, 15522, 15531, 15532, 15608, 15609, 15610, 15632, 15640, 15670,
- 15672, 15680, 15681, 15723, 15734, 15735, 15736, 15748, 15749, 15754,
- 15760, 15764, 15797, 15799, 15825, 15844, 15847, 15849, 15855, 15856,
- 15857, 15859, 15867, 15886, 15887, 15890, 15892, 15893, 15895, 15897,
- 15905, 15909, 15919, 15921, 15923, 15939, 15948, 15963, 15966, 15988,
- 16032, 16034, 16036, 16041, 16071, 16072, 16074, 16078.
+ 156, 431, 832, 2801, 9954, 10278, 11087, 13028, 13982, 13985, 14029,
+ 14155, 14547, 14699, 14876, 14910, 15048, 15218, 15277, 15308, 15362,
+ 15400, 15427, 15522, 15531, 15532, 15608, 15609, 15610, 15632, 15640,
+ 15670, 15672, 15680, 15681, 15723, 15734, 15735, 15736, 15748, 15749,
+ 15754, 15760, 15764, 15797, 15799, 15825, 15844, 15847, 15849, 15855,
+ 15856, 15857, 15859, 15867, 15886, 15887, 15890, 15892, 15893, 15895,
+ 15897, 15905, 15909, 15919, 15921, 15923, 15939, 15948, 15963, 15966,
+ 15988, 16032, 16034, 16036, 16041, 16071, 16072, 16074, 16078.
* CVE-2012-4412 The strcoll implementation caches indices and rules for
large collation sequences to optimize multiple passes. This cache
mchunkptr remainder; /* remainder from allocation */
unsigned long remainder_size; /* its size */
- unsigned long sum; /* for updating stats */
size_t pagemask = GLRO(dl_pagesize) - 1;
bool tried_mmap = false;
/* update statistics */
- if (++mp_.n_mmaps > mp_.max_n_mmaps)
- mp_.max_n_mmaps = mp_.n_mmaps;
+ int new = atomic_exchange_and_add (&mp_.n_mmaps, 1) + 1;
+ atomic_max (&mp_.max_n_mmaps, new);
- sum = mp_.mmapped_mem += size;
- if (sum > (unsigned long)(mp_.max_mmapped_mem))
- mp_.max_mmapped_mem = sum;
+ unsigned long sum;
+ sum = atomic_exchange_and_add(&mp_.mmapped_mem, size) + size;
+ atomic_max (&mp_.max_mmapped_mem, sum);
check_chunk(av, p);
return;
}
- mp_.n_mmaps--;
- mp_.mmapped_mem -= total_size;
+ atomic_decrement (&mp_.n_mmaps);
+ atomic_add (&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
assert((p->prev_size == offset));
set_head(p, (new_size - offset)|IS_MMAPPED);
- mp_.mmapped_mem -= size + offset;
- mp_.mmapped_mem += new_size;
- if ((unsigned long)mp_.mmapped_mem > (unsigned long)mp_.max_mmapped_mem)
- mp_.max_mmapped_mem = mp_.mmapped_mem;
+ INTERNAL_SIZE_T new;
+ new = atomic_exchange_and_add (&mp_.mmapped_mem, new_size - size - offset)
+ + new_size - size - offset;
+ atomic_max (&mp_.max_mmapped_mem, new);
return p;
}