aboutsummaryrefslogtreecommitdiff
path: root/lib/sanitizer_common/sanitizer_allocator_internal.h
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2017-05-16 19:47:19 +0000
committerDimitry Andric <dim@FreeBSD.org>2017-05-16 19:47:19 +0000
commitf9102cdabba485d415359124bece145f4a7d9089 (patch)
tree8eb48238e74ed80be2c4feea51adc53445040d76 /lib/sanitizer_common/sanitizer_allocator_internal.h
parent2109e2e4181555140883e9ec46807746a0eabad2 (diff)
downloadsrc-f9102cdabba485d415359124bece145f4a7d9089.tar.gz
src-f9102cdabba485d415359124bece145f4a7d9089.zip
Vendor import of compiler-rt trunk r303197:vendor/compiler-rt/compiler-rt-trunk-r303197
Notes
Notes: svn path=/vendor/compiler-rt/dist/; revision=318372 svn path=/vendor/compiler-rt/compiler-rt-trunk-r303197/; revision=318373; tag=vendor/compiler-rt/compiler-rt-trunk-r303197
Diffstat (limited to 'lib/sanitizer_common/sanitizer_allocator_internal.h')
-rw-r--r--lib/sanitizer_common/sanitizer_allocator_internal.h22
1 files changed, 13 insertions, 9 deletions
diff --git a/lib/sanitizer_common/sanitizer_allocator_internal.h b/lib/sanitizer_common/sanitizer_allocator_internal.h
index e939cbe01c3c..d1890f20f810 100644
--- a/lib/sanitizer_common/sanitizer_allocator_internal.h
+++ b/lib/sanitizer_common/sanitizer_allocator_internal.h
@@ -23,21 +23,25 @@ namespace __sanitizer {
// purposes.
typedef CompactSizeClassMap InternalSizeClassMap;
-static const uptr kInternalAllocatorSpace = 0;
-static const u64 kInternalAllocatorSize = SANITIZER_MMAP_RANGE_SIZE;
static const uptr kInternalAllocatorRegionSizeLog = 20;
-#if SANITIZER_WORDSIZE == 32
static const uptr kInternalAllocatorNumRegions =
- kInternalAllocatorSize >> kInternalAllocatorRegionSizeLog;
+ SANITIZER_MMAP_RANGE_SIZE >> kInternalAllocatorRegionSizeLog;
+#if SANITIZER_WORDSIZE == 32
typedef FlatByteMap<kInternalAllocatorNumRegions> ByteMap;
#else
-static const uptr kInternalAllocatorNumRegions =
- kInternalAllocatorSize >> kInternalAllocatorRegionSizeLog;
typedef TwoLevelByteMap<(kInternalAllocatorNumRegions >> 12), 1 << 12> ByteMap;
#endif
-typedef SizeClassAllocator32<
- kInternalAllocatorSpace, kInternalAllocatorSize, 0, InternalSizeClassMap,
- kInternalAllocatorRegionSizeLog, ByteMap> PrimaryInternalAllocator;
+struct AP32 {
+ static const uptr kSpaceBeg = 0;
+ static const u64 kSpaceSize = SANITIZER_MMAP_RANGE_SIZE;
+ static const uptr kMetadataSize = 0;
+ typedef InternalSizeClassMap SizeClassMap;
+ static const uptr kRegionSizeLog = kInternalAllocatorRegionSizeLog;
+ typedef __sanitizer::ByteMap ByteMap;
+ typedef NoOpMapUnmapCallback MapUnmapCallback;
+ static const uptr kFlags = 0;
+};
+typedef SizeClassAllocator32<AP32> PrimaryInternalAllocator;
typedef SizeClassAllocatorLocalCache<PrimaryInternalAllocator>
InternalAllocatorCache;