[sanitizer] Construct InternalMmapVector without memory allocation.
authorIgor Kudrin <ikudrin@accesssoftek.com>
Wed, 11 Dec 2019 10:37:24 +0000 (17:37 +0700)
committerIgor Kudrin <ikudrin@accesssoftek.com>
Tue, 17 Dec 2019 08:03:23 +0000 (15:03 +0700)
commita57adc7a0b0dac5484f19f9061eba432d0db19e8
tree2f5c99fac06d82fdf17f06eada3720af442597b4
parent5279f96577af1457a973c071ec5ee3554c9f6cbe
[sanitizer] Construct InternalMmapVector without memory allocation.

Construction of InternalMmapVector is often followed by a call to
reserve(), which may result in immediate reallocation of the memory
for the internal storage. This patch delays that allocation until
it is really needed.

Differential Revision: https://reviews.llvm.org/D71342
compiler-rt/lib/sanitizer_common/sanitizer_common.h
compiler-rt/lib/sanitizer_common/tests/sanitizer_common_test.cpp