Skip to content

Commit

Permalink
tsan: remove dependencies on HAS_48_BIT_ADDRESS_SPACE and Mapping
Browse files Browse the repository at this point in the history
Remove direct uses of Mapping in preperation for removing Mapping type
(which we already don't have for all platforms).
Remove dependence on HAS_48_BIT_ADDRESS_SPACE in preparation for removing it.
As far as I see for Apple/Mac platforms !HAS_48_BIT_ADDRESS_SPACE
simply means SANITIZER_IOS.

Depends on D107741.

Reviewed By: melver

Differential Revision: https://reviews.llvm.org/D107742
  • Loading branch information
dvyukov committed Aug 10, 2021
1 parent 0ebfe7c commit 959076c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
6 changes: 3 additions & 3 deletions compiler-rt/lib/tsan/rtl/tsan_platform_mac.cpp
Expand Up @@ -234,11 +234,11 @@ static void my_pthread_introspection_hook(unsigned int event, pthread_t thread,
#endif

void InitializePlatformEarly() {
#if !SANITIZER_GO && !HAS_48_BIT_ADDRESS_SPACE
# if !SANITIZER_GO && SANITIZER_IOS
uptr max_vm = GetMaxUserVirtualAddress() + 1;
if (max_vm != Mapping::kHiAppMemEnd) {
if (max_vm != HiAppMemEnd()) {
Printf("ThreadSanitizer: unsupported vm address limit %p, expected %p.\n",
max_vm, Mapping::kHiAppMemEnd);
max_vm, HiAppMemEnd());
Die();
}
#endif
Expand Down
2 changes: 1 addition & 1 deletion compiler-rt/lib/tsan/rtl/tsan_platform_posix.cpp
Expand Up @@ -103,7 +103,7 @@ void CheckAndProtect() {
Die();
}

#if defined(__aarch64__) && defined(__APPLE__) && !HAS_48_BIT_ADDRESS_SPACE
# if defined(__aarch64__) && defined(__APPLE__) && SANITIZER_IOS
ProtectRange(HeapMemEnd(), ShadowBeg());
ProtectRange(ShadowEnd(), MetaShadowBeg());
ProtectRange(MetaShadowEnd(), TraceMemBeg());
Expand Down
5 changes: 5 additions & 0 deletions compiler-rt/lib/tsan/rtl/tsan_rtl.h
Expand Up @@ -69,6 +69,11 @@ struct AP32 {
typedef SizeClassAllocator32<AP32> PrimaryAllocator;
#else
struct AP64 { // Allocator64 parameters. Deliberately using a short name.
# if defined(__s390x__)
typedef MappingS390x Mapping;
# else
typedef Mapping48AddressSpace Mapping;
# endif
static const uptr kSpaceBeg = Mapping::kHeapMemBeg;
static const uptr kSpaceSize = Mapping::kHeapMemEnd - Mapping::kHeapMemBeg;
static const uptr kMetadataSize = 0;
Expand Down

0 comments on commit 959076c

Please sign in to comment.