[asancov] Fix coverage reserving 4x the necessary amount of memory on fork.

llvm-svn: 236294
This commit is contained in:
Evgeniy Stepanov 2015-05-01 00:40:42 +00:00
parent 312b15adb9
commit b0707833a1
1 changed files with 2 additions and 1 deletions

View File

@ -266,8 +266,9 @@ void CoverageData::ReInit() {
// In memory-mapped mode we must extend the new file to the known array
// size.
uptr size = atomic_load(&pc_array_size, memory_order_relaxed);
uptr npcs = size / sizeof(uptr);
Enable();
if (size) Extend(size);
if (size) Extend(npcs);
if (coverage_enabled) CovUpdateMapping(coverage_dir);
} else {
Enable();