diff options
author | Kostya Serebryany <kcc@google.com> | 2016-08-25 20:23:08 +0000 |
---|---|---|
committer | Kostya Serebryany <kcc@google.com> | 2016-08-25 20:23:08 +0000 |
commit | 2521dc2591c635e2644b6f01afee127ca0d1f9c2 (patch) | |
tree | 7c111962c8602e3af5dbdd78632b389498605262 /lib/scudo/scudo_allocator.cpp | |
parent | eeb461eb3b8232a3c422fd1fc86ee9681f64e286 (diff) |
[sanitizer] change SizeClassAllocator64 to accept just one template parameter instead of 5. First, this will make the mangled names shorter. Second, this will make adding more parameters simpler.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@279771 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/scudo/scudo_allocator.cpp')
-rw-r--r-- | lib/scudo/scudo_allocator.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/lib/scudo/scudo_allocator.cpp b/lib/scudo/scudo_allocator.cpp index ceb7bbdd4..b5d8fc8bf 100644 --- a/lib/scudo/scudo_allocator.cpp +++ b/lib/scudo/scudo_allocator.cpp @@ -29,14 +29,18 @@ namespace __scudo { -const uptr AllocatorSpace = ~0ULL; -const uptr AllocatorSize = 0x10000000000ULL; const uptr MinAlignmentLog = 4; // 16 bytes for x64 const uptr MaxAlignmentLog = 24; -typedef DefaultSizeClassMap SizeClassMap; -typedef SizeClassAllocator64<AllocatorSpace, AllocatorSize, 0, SizeClassMap> - PrimaryAllocator; +struct AP { + static const uptr kSpaceBeg = ~0ULL; + static const uptr kSpaceSize = 0x10000000000ULL; + static const uptr kMetadataSize = 0; + typedef DefaultSizeClassMap SizeClassMap; + typedef NoOpMapUnmapCallback MapUnmapCallback; +}; + +typedef SizeClassAllocator64<AP> PrimaryAllocator; typedef SizeClassAllocatorLocalCache<PrimaryAllocator> AllocatorCache; typedef LargeMmapAllocator<> SecondaryAllocator; typedef CombinedAllocator<PrimaryAllocator, AllocatorCache, SecondaryAllocator> |