Skip to content
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions compiler-rt/lib/asan/asan_allocator.h
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,11 @@ const uptr kAllocatorSpace = ~(uptr)0;
# endif // SANITIZER_APPLE

# if defined(__powerpc64__)
# if SANITIZER_AIX
const uptr kAllocatorSize = 1ULL << 38; // 256G.
# else
const uptr kAllocatorSize = 0x20000000000ULL; // 2T.
# endif
typedef DefaultSizeClassMap SizeClassMap;
# elif defined(__aarch64__) && SANITIZER_ANDROID
// Android needs to support 39, 42 and 48 bit VMA.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,7 @@ class SizeClassAllocator32 {
uptr ComputeRegionId(uptr mem) const {
if (SANITIZER_SIGN_EXTENDED_ADDRESSES)
mem &= (kSpaceSize - 1);
mem -= kSpaceBeg;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does not look NFC for other platforms?

also seems mem &= is to achieve the similar thing. Combining both seems wrong?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kSpaceBeg is zero for other platforms, so it's NFC.

&= doesn't always give the same result as -= if mem is high enough. For example, if mem = 0x0c00 and kSpaceBeg = 0x0a00.

const uptr res = mem >> kRegionSizeLog;
CHECK_LT(res, kNumPossibleRegions);
return res;
Expand Down
6 changes: 5 additions & 1 deletion compiler-rt/lib/sanitizer_common/sanitizer_platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,11 @@
#endif

// The first address that can be returned by mmap.
#define SANITIZER_MMAP_BEGIN 0
#if SANITIZER_AIX && SANITIZER_WORDSIZE == 64
# define SANITIZER_MMAP_BEGIN 0x0a00000000000000ULL
#else
# define SANITIZER_MMAP_BEGIN 0
#endif

// The range of addresses which can be returned my mmap.
// FIXME: this value should be different on different platforms. Larger values
Expand Down
Loading