Commit 93786908 authored by Bartek Nowierski's avatar Bartek Nowierski Committed by Chromium LUCI CQ

PCScan: Disable unconditionally on 32-bit systems

All partitions on 32-bit systems are marked non-scannable, effectively
disabling PCScan and preventing address space waste for quarantine
bitmaps that would never materialize.

Bug: 1159694
Change-Id: I6fea110633ea0a72146beb917810b8b04d603f23
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2601894Reviewed-by: default avatarAnton Bikineev <bikineev@chromium.org>
Commit-Queue: Bartek Nowierski <bartekn@chromium.org>
Auto-Submit: Bartek Nowierski <bartekn@chromium.org>
Cr-Commit-Position: refs/heads/master@{#840457}
parent e46c3622
...@@ -20,6 +20,10 @@ template <bool thread_safe> ...@@ -20,6 +20,10 @@ template <bool thread_safe>
typename PartitionRoot<thread_safe>::PCScanMode PartitionOptionsToPCScanMode( typename PartitionRoot<thread_safe>::PCScanMode PartitionOptionsToPCScanMode(
PartitionOptions::PCScan opt) { PartitionOptions::PCScan opt) {
using Root = PartitionRoot<thread_safe>; using Root = PartitionRoot<thread_safe>;
// PCScan is currently only supported on 64-bit systems.
// Mark partitions non-scannable on 32-bit systems unconditionally, so that
// address space for quarantine bitmaps doesn't get reserved.
#if defined(PA_HAS_64_BITS_POINTERS)
switch (opt) { switch (opt) {
case PartitionOptions::PCScan::kAlwaysDisabled: case PartitionOptions::PCScan::kAlwaysDisabled:
return Root::PCScanMode::kNonScannable; return Root::PCScanMode::kNonScannable;
...@@ -28,6 +32,9 @@ typename PartitionRoot<thread_safe>::PCScanMode PartitionOptionsToPCScanMode( ...@@ -28,6 +32,9 @@ typename PartitionRoot<thread_safe>::PCScanMode PartitionOptionsToPCScanMode(
case PartitionOptions::PCScan::kForcedEnabledForTesting: case PartitionOptions::PCScan::kForcedEnabledForTesting:
return Root::PCScanMode::kEnabled; return Root::PCScanMode::kEnabled;
} }
#else
return Root::PCScanMode::kNonScannable;
#endif
} }
} // namespace } // namespace
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
#include "base/allocator/partition_allocator/partition_root.h" #include "base/allocator/partition_allocator/partition_root.h"
#if !defined(MEMORY_TOOL_REPLACES_ALLOCATOR) #if !defined(MEMORY_TOOL_REPLACES_ALLOCATOR)
#if defined(PA_HAS_64_BITS_POINTERS)
#include "base/allocator/partition_allocator/pcscan.h" #include "base/allocator/partition_allocator/pcscan.h"
...@@ -329,4 +330,5 @@ TEST_F(PCScanTest, DanglingInterPartitionReference) { ...@@ -329,4 +330,5 @@ TEST_F(PCScanTest, DanglingInterPartitionReference) {
} // namespace internal } // namespace internal
} // namespace base } // namespace base
#endif // defined(PA_HAS_64_BITS_POINTERS)
#endif // defined(MEMORY_TOOL_REPLACES_ALLOCATOR) #endif // defined(MEMORY_TOOL_REPLACES_ALLOCATOR)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment