Skip to content

Commit be6b346

Browse files
committed
[Sanitizer] Clean up SANITIZER_CAN_USE_ALLOCATOR64 logic
Update: A change to this code recently broke our bots after this change enabled the 64 bit allocator for defined(aarch64): https://reviews.llvm.org/D137136 We added logic initially to get our test passing, but want to further clean up this code to enable MacOS to use allocator64 and increase readability and clarity of the logic. rdar://103647896 Differential Revision: https://reviews.llvm.org/D141171 (cherry picked from commit 87850e9)
1 parent 16bf28f commit be6b346

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

compiler-rt/lib/sanitizer_common/sanitizer_platform.h

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -279,15 +279,14 @@
279279
#endif
280280

281281
// By default we allow to use SizeClassAllocator64 on 64-bit platform.
282-
// But in some cases (e.g. AArch64's 39-bit address space) SizeClassAllocator64
283-
// does not work well and we need to fallback to SizeClassAllocator32.
282+
// But in some cases SizeClassAllocator64 does not work well and we need to
283+
// fallback to SizeClassAllocator32.
284284
// For such platforms build this code with -DSANITIZER_CAN_USE_ALLOCATOR64=0 or
285285
// change the definition of SANITIZER_CAN_USE_ALLOCATOR64 here.
286286
#ifndef SANITIZER_CAN_USE_ALLOCATOR64
287-
# if (SANITIZER_ANDROID && defined(__aarch64__)) || SANITIZER_FUCHSIA
288-
# define SANITIZER_CAN_USE_ALLOCATOR64 1
289-
# elif defined(__mips64) || defined(__aarch64__) || defined(__i386__) || \
290-
defined(__arm__) || SANITIZER_RISCV64 || defined(__hexagon__)
287+
# if SANITIZER_RISCV64 || SANITIZER_IOS
288+
# define SANITIZER_CAN_USE_ALLOCATOR64 0
289+
# elif defined(__mips64) || defined(__hexagon__)
291290
# define SANITIZER_CAN_USE_ALLOCATOR64 0
292291
# else
293292
# define SANITIZER_CAN_USE_ALLOCATOR64 (SANITIZER_WORDSIZE == 64)

0 commit comments

Comments
 (0)