diff options
author | Alex Shlyapnikov <alekseys@google.com> | 2018-02-24 01:00:27 +0000 |
---|---|---|
committer | Alex Shlyapnikov <alekseys@google.com> | 2018-02-24 01:00:27 +0000 |
commit | 326a82bf8131ca47356f91d661c4b6e681f3fb62 (patch) | |
tree | 81872912fd62dd0462a7029df09236107438169a /lib/sanitizer_common/sanitizer_allocator_internal.h | |
parent | d84e57a96b4fad4bc8f94c24e787097f0a89a534 (diff) | |
download | compiler-rt-326a82bf8131ca47356f91d661c4b6e681f3fb62.tar.gz |
[Sanitizers] Increase allocated chunk limit for LargeMmapAllocator
Summary:
There are applications out there which allocate more than 1 << 18 large chunks
of memory (those handled by LargeMmapAllocator, aka secondary allocator).
For 64 bits, secondary allocator stores allocated chunks in a growing on
demand region of memory, growing in blocks of 128K, up to 1 << 20 chunks total.
Sanitizer internal allocator's secondary uses fixed size array storing up
to 1 << 15 chunks (down to 256K from 2Mb of memory used for that array).
Nothing is changed for 32 bits, chunks are still stored in the fixed size
array (up to 1 << 15 chunks).
Reviewers: eugenis
Subscribers: kubamracek, delcypher, #sanitizers, llvm-commits
Differential Revision: https://reviews.llvm.org/D43693
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@326007 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/sanitizer_common/sanitizer_allocator_internal.h')
-rw-r--r-- | lib/sanitizer_common/sanitizer_allocator_internal.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/sanitizer_common/sanitizer_allocator_internal.h b/lib/sanitizer_common/sanitizer_allocator_internal.h index 10536a965..2a1fa1d7f 100644 --- a/lib/sanitizer_common/sanitizer_allocator_internal.h +++ b/lib/sanitizer_common/sanitizer_allocator_internal.h @@ -46,9 +46,12 @@ typedef SizeClassAllocator32<AP32> PrimaryInternalAllocator; typedef SizeClassAllocatorLocalCache<PrimaryInternalAllocator> InternalAllocatorCache; +typedef LargeMmapAllocator<NoOpMapUnmapCallback, + LargeMmapAllocatorPtrArrayStatic> + SecondaryInternalAllocator; + typedef CombinedAllocator<PrimaryInternalAllocator, InternalAllocatorCache, - LargeMmapAllocator<NoOpMapUnmapCallback> - > InternalAllocator; + SecondaryInternalAllocator> InternalAllocator; void *InternalAlloc(uptr size, InternalAllocatorCache *cache = nullptr, uptr alignment = 0); |