[SanitizerCommon] Reduce wasting memory in LowLevelAllocator.
authorIgor Kudrin <ikudrin@accesssoftek.com>
Tue, 10 Dec 2019 14:44:17 +0000 (21:44 +0700)
committerIgor Kudrin <ikudrin@accesssoftek.com>
Wed, 11 Dec 2019 05:44:55 +0000 (12:44 +0700)
commit3a713ae5fa64a0b2043bd6748b87d4ba7f7c2fce
tree5ca00891d4d6e7e2449162925e0be9140333a55f
parentf7235ac1d3154d5cd82a9a6bfdfffd050e6f5d05
[SanitizerCommon] Reduce wasting memory in LowLevelAllocator.

MmapOrDie allocates memory multiple to page size. LowLevelAllocator
should use all that memory for the internal buffer because there are
chances that subsequent requests may be small enough to fit in that
space.

Differential Revision: https://reviews.llvm.org/D71275
compiler-rt/lib/sanitizer_common/sanitizer_allocator.cpp
compiler-rt/lib/sanitizer_common/tests/sanitizer_allocator_test.cpp