Commit f4811e8e authored by Michael Lippautz's avatar Michael Lippautz Committed by Commit Bot

PCScan: Remove compile-time guard

These days PCScan and its bitmaps are lazily committed after startup.
Since bitmaps are not committed until PCScan is enabled, there is no
need for having a separate compile-time flag to avoid paying for used
memory.

Bug: 11297512
Change-Id: I9226a718be6309bc43de5f9f67e7c84e223eacbd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2539198
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: default avatarBartek Nowierski <bartekn@chromium.org>
Cr-Commit-Position: refs/heads/master@{#827925}
parent dcef348c
......@@ -20,12 +20,10 @@ const Feature kPartitionAllocGigaCage{"PartitionAllocGigaCage32bit",
FEATURE_DISABLED_BY_DEFAULT};
#endif
#if ALLOW_ENABLING_PCSCAN
// If enabled, PCScan is turned on by default for all partitions that don't
// disable it explicitly.
const Feature kPartitionAllocPCScan{"PartitionAllocPCScan",
FEATURE_DISABLED_BY_DEFAULT};
#endif
} // namespace features
} // namespace base
......@@ -19,8 +19,6 @@
#include <VersionHelpers.h>
#endif
#define ALLOW_ENABLING_PCSCAN 0
namespace base {
struct Feature;
......@@ -63,9 +61,9 @@ ALWAYS_INLINE bool IsPartitionAllocGigaCageEnabled() {
}
ALWAYS_INLINE bool IsPartitionAllocPCScanEnabled() {
#if !defined(PA_HAS_64_BITS_POINTERS) || !ALLOW_ENABLING_PCSCAN
#if !defined(PA_HAS_64_BITS_POINTERS)
return false;
#endif
#endif // !PA_HAS_64_BITS_POINTERS
// TODO(bikineev): Calling this function can allocate which can cause
// reentrancy for the 'PA as malloc' configuration.
return FeatureList::IsEnabled(kPartitionAllocPCScan);
......
......@@ -369,11 +369,7 @@ void PartitionRoot<thread_safe>::Init(PartitionOptions opts) {
// the beginning of the slot.
allow_extras = (opts.alignment != PartitionOptions::Alignment::kAlignedAlloc);
#if ALLOW_ENABLING_PCSCAN
scannable = (opts.pcscan != PartitionOptions::PCScan::kAlwaysDisabled);
#else
scannable = false;
#endif
// Concurrent freeing in PCScan can only safely work on thread-safe
// partitions.
if (thread_safe &&
......
......@@ -9,8 +9,6 @@
#include "base/allocator/partition_allocator/partition_alloc.h"
#include "testing/gtest/include/gtest/gtest.h"
#if ALLOW_ENABLING_PCSCAN
namespace base {
namespace internal {
......@@ -307,6 +305,4 @@ TEST_F(PCScanTest, DanglingInnerReference) {
} // namespace internal
} // namespace base
#endif
#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