Skip to content

Commit

Permalink
[NFC][Sanitizer] Refine the restriction on SizeClassAllocator64::kReg…
Browse files Browse the repository at this point in the history
…ionSize (#86270)

This patch replaces the `SANITIZER_WORDSIZE / 2` with
`sizeof(CompactPtrT) * 8`, replaces hardcoded `4` with
`kCompactPtrScale` in assertion.
  • Loading branch information
Enna1 committed Mar 27, 2024
1 parent d023995 commit 4720e38
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -639,7 +639,8 @@ class SizeClassAllocator64 {
static_assert(kRegionSize >= SizeClassMap::kMaxSize,
"Region size exceed largest size");
// kRegionSize must be <= 2^36, see CompactPtrT.
COMPILER_CHECK((kRegionSize) <= (1ULL << (SANITIZER_WORDSIZE / 2 + 4)));
COMPILER_CHECK((kRegionSize) <=
(1ULL << (sizeof(CompactPtrT) * 8 + kCompactPtrScale)));
// Call mmap for user memory with at least this size.
static const uptr kUserMapSize = 1 << 18;
// Call mmap for metadata memory with at least this size.
Expand Down

0 comments on commit 4720e38

Please sign in to comment.