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