qt5-qtwebengine/qtwebengine-everywhere-src-5.11.1-enable-64k-pagesize.patch
wei dong d2c0d6376a 修复64k页大小的时候,运行错误
Signed-off-by: wei dong <weidong@uniontech.com>
2021-12-22 17:28:00 +08:00

90 lines
4.2 KiB
Diff

diff --git a/src/3rdparty/chromium/base/allocator/partition_allocator/page_allocator.h b/src/3rdparty/chromium/base/allocator/partition_allocator/page_allocator.h
index a39b4e3013e82fcfcde99d6e4e0a4bb798260984..a25d7a4e16ba9fec94617e1e82631604ebe1d852 100644
--- a/src/3rdparty/chromium/base/allocator/partition_allocator/page_allocator.h
+++ b/src/3rdparty/chromium/base/allocator/partition_allocator/page_allocator.h
@@ -15,13 +15,13 @@
namespace base {
-#if defined(OS_WIN)
+//#if defined(OS_WIN)
static const size_t kPageAllocationGranularityShift = 16; // 64KB
-#elif defined(_MIPS_ARCH_LOONGSON)
-static const size_t kPageAllocationGranularityShift = 14; // 16KB
-#else
-static const size_t kPageAllocationGranularityShift = 12; // 4KB
-#endif
+//#elif defined(_MIPS_ARCH_LOONGSON)
+//static const size_t kPageAllocationGranularityShift = 14; // 16KB
+//#else
+//static const size_t kPageAllocationGranularityShift = 12; // 4KB
+//#endif
static const size_t kPageAllocationGranularity =
1 << kPageAllocationGranularityShift;
static const size_t kPageAllocationGranularityOffsetMask =
@@ -29,11 +29,11 @@ static const size_t kPageAllocationGranularityOffsetMask =
static const size_t kPageAllocationGranularityBaseMask =
~kPageAllocationGranularityOffsetMask;
-#if defined(_MIPS_ARCH_LOONGSON)
-static const size_t kSystemPageSize = 16384;
-#else
-static const size_t kSystemPageSize = 4096;
-#endif
+//#if defined(_MIPS_ARCH_LOONGSON)
+//static const size_t kSystemPageSize = 16384;
+//#else
+static const size_t kSystemPageSize = 65536;
+//#endif
static const size_t kSystemPageOffsetMask = kSystemPageSize - 1;
static_assert((kSystemPageSize & (kSystemPageSize - 1)) == 0,
"kSystemPageSize must be power of 2");
diff --git a/src/3rdparty/chromium/base/allocator/partition_allocator/partition_alloc.h b/src/3rdparty/chromium/base/allocator/partition_allocator/partition_alloc.h
index 6e5143b094ae2e99fdcfe6b9d60d93a662200d29..4f7c1498ee2618464a4cd9dfa473ea28ea9a3944 100644
--- a/src/3rdparty/chromium/base/allocator/partition_allocator/partition_alloc.h
+++ b/src/3rdparty/chromium/base/allocator/partition_allocator/partition_alloc.h
@@ -97,11 +97,14 @@ static const size_t kBucketShift = (kAllocationGranularity == 8) ? 3 : 2;
// system page of the span. For our current max slot span size of 64k and other
// constant values, we pack _all_ PartitionRootGeneric::Alloc() sizes perfectly
// up against the end of a system page.
-#if defined(_MIPS_ARCH_LOONGSON)
-static const size_t kPartitionPageShift = 16; // 64KB
-#else
-static const size_t kPartitionPageShift = 14; // 16KB
-#endif
+//#if defined(_MIPS_ARCH_LOONGSON)
+//static const size_t kPartitionPageShift = 16; // 64KB
+//#else
+//static const size_t kPartitionPageShift = 14; // 16KB
+//#endif
+
+static const size_t kPartitionPageShift = 18; // 256KB
+
static const size_t kPartitionPageSize = 1 << kPartitionPageShift;
static const size_t kPartitionPageOffsetMask = kPartitionPageSize - 1;
static const size_t kPartitionPageBaseMask = ~kPartitionPageOffsetMask;
diff --git a/src/3rdparty/chromium/third_party/WebKit/Source/platform/heap/HeapPage.h b/src/3rdparty/chromium/third_party/WebKit/Source/platform/heap/HeapPage.h
index 20674563ebabb60dccbb8adb4ebc2a4b2cee4117..7b47a30d5502f6c1222226017cddfac6082daeec 100644
--- a/src/3rdparty/chromium/third_party/WebKit/Source/platform/heap/HeapPage.h
+++ b/src/3rdparty/chromium/third_party/WebKit/Source/platform/heap/HeapPage.h
@@ -62,15 +62,15 @@ constexpr size_t kBlinkPageBaseMask = ~kBlinkPageOffsetMask;
constexpr size_t kBlinkPagesPerRegion = 10;
// TODO(nya): Replace this with something like #if ENABLE_NACL.
-#if 0
+//#if 0
// NaCl's system page size is 64 KiB. This causes a problem in Oilpan's heap
// layout because Oilpan allocates two guard pages for each Blink page (whose
// size is kBlinkPageSize = 2^17 = 128 KiB). So we don't use guard pages in
// NaCl.
constexpr size_t kBlinkGuardPageSize = 0;
-#else
-constexpr size_t kBlinkGuardPageSize = base::kSystemPageSize;
-#endif
+//#else
+//constexpr size_t kBlinkGuardPageSize = base::kSystemPageSize;
+//#endif
// Double precision floats are more efficient when 8-byte aligned, so we 8-byte
// align all allocations (even on 32 bit systems).