* config/i386/i386.md (fmodxf3): Enable for flag_finite_math_only only.
[official-gcc.git] / libsanitizer / sanitizer_common / sanitizer_allocator_internal.h
blob5e8cc1077061ee633d3176219247448d75a5de9d
1 //===-- sanitizer_allocator_internal.h -------------------------- C++ -----===//
2 //
3 // This file is distributed under the University of Illinois Open Source
4 // License. See LICENSE.TXT for details.
5 //
6 //===----------------------------------------------------------------------===//
7 //
8 // This allocator is used inside run-times.
9 //
10 //===----------------------------------------------------------------------===//
12 #ifndef SANITIZER_ALLOCATOR_INTERNAL_H
13 #define SANITIZER_ALLOCATOR_INTERNAL_H
15 #include "sanitizer_allocator.h"
16 #include "sanitizer_internal_defs.h"
18 namespace __sanitizer {
20 // FIXME: Check if we may use even more compact size class map for internal
21 // purposes.
22 typedef CompactSizeClassMap InternalSizeClassMap;
24 static const uptr kInternalAllocatorSpace = 0;
25 static const u64 kInternalAllocatorSize = SANITIZER_MMAP_RANGE_SIZE;
26 static const uptr kInternalAllocatorRegionSizeLog = 20;
27 #if SANITIZER_WORDSIZE == 32
28 static const uptr kInternalAllocatorNumRegions =
29 kInternalAllocatorSize >> kInternalAllocatorRegionSizeLog;
30 typedef FlatByteMap<kInternalAllocatorNumRegions> ByteMap;
31 #else
32 static const uptr kInternalAllocatorNumRegions =
33 kInternalAllocatorSize >> kInternalAllocatorRegionSizeLog;
34 typedef TwoLevelByteMap<(kInternalAllocatorNumRegions >> 12), 1 << 12> ByteMap;
35 #endif
36 typedef SizeClassAllocator32<
37 kInternalAllocatorSpace, kInternalAllocatorSize, 0, InternalSizeClassMap,
38 kInternalAllocatorRegionSizeLog, ByteMap> PrimaryInternalAllocator;
40 typedef SizeClassAllocatorLocalCache<PrimaryInternalAllocator>
41 InternalAllocatorCache;
43 typedef CombinedAllocator<PrimaryInternalAllocator, InternalAllocatorCache,
44 LargeMmapAllocator<> > InternalAllocator;
46 void *InternalAlloc(uptr size, InternalAllocatorCache *cache = 0);
47 void InternalFree(void *p, InternalAllocatorCache *cache = 0);
48 InternalAllocator *internal_allocator();
50 } // namespace __sanitizer
52 #endif // SANITIZER_ALLOCATOR_INTERNAL_H