-
Notifications
You must be signed in to change notification settings - Fork 15.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: add partition alloc check for MacOS 13/14+ (#40765)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: VerteDinde <vertedinde@electronjs.org>
- Loading branch information
1 parent
aa8d667
commit 9b2ddea
Showing
2 changed files
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
patches/chromium/enable_partition_alloc_ref_count_size.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
From: VerteDinde <vertedinde@electronjs.org> | ||
Date: Wed, 13 Dec 2023 12:53:11 -0800 | ||
Subject: fix: enable partition alloc ref count size for MacOS 13+ | ||
|
||
Modifies an existing check to check for all versions of MacOS 13 | ||
or higher, including MacOS 14 and potential beta versions. | ||
|
||
This patch is currently being added upstream, and can be removed | ||
when we integrate the upstream changes into Electron. | ||
|
||
diff --git a/base/allocator/partition_allocator/src/partition_alloc/partition_ref_count.h b/base/allocator/partition_allocator/src/partition_alloc/partition_ref_count.h | ||
index 0db9a269dbfd2d2397fac49efdbf96b6077942fd..fba2391b96db8d9ac2e18b448a3fdf65677f5505 100644 | ||
--- a/base/allocator/partition_allocator/src/partition_alloc/partition_ref_count.h | ||
+++ b/base/allocator/partition_allocator/src/partition_alloc/partition_ref_count.h | ||
@@ -30,7 +30,7 @@ namespace partition_alloc::internal { | ||
|
||
// Aligns up (on 8B boundary) and returns `ref_count_size` if needed. | ||
// * Known to be needed on MacOS 13: https://crbug.com/1378822. | ||
-// * Thought to be needed on MacOS 14: https://crbug.com/1457756. | ||
+// * Thought to be needed on MacOS 14 and higher: https://crbug.com/1457756. | ||
// * No-op everywhere else. | ||
// | ||
// Placed outside `BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)` | ||
@@ -38,8 +38,7 @@ namespace partition_alloc::internal { | ||
// this gating. | ||
PA_ALWAYS_INLINE size_t AlignUpRefCountSizeForMac(size_t ref_count_size) { | ||
#if BUILDFLAG(IS_MAC) | ||
- if (internal::base::mac::MacOSMajorVersion() == 13 || | ||
- internal::base::mac::MacOSMajorVersion() == 14) { | ||
+ if (internal::base::mac::MacOSMajorVersion() >= 13) { | ||
return internal::base::bits::AlignUp(ref_count_size, 8); | ||
} | ||
#endif // BUILDFLAG(IS_MAC) |