enable_partition_alloc_ref_count_size.patch 1.7 KB

12345678910111213141516171819202122232425262728293031323334
  1. From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
  2. From: VerteDinde <[email protected]>
  3. Date: Wed, 13 Dec 2023 12:53:11 -0800
  4. Subject: fix: enable partition alloc ref count size for MacOS 13+
  5. Modifies an existing check to check for all versions of MacOS 13
  6. or higher, including MacOS 14 and potential beta versions.
  7. This patch is currently being added upstream, and can be removed
  8. when we integrate the upstream changes into Electron.
  9. 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
  10. index cfc0e1092fc560408c75c54d033cf76c5ef9348a..8ca7df7d43c11229149385156d3390a717428a27 100644
  11. --- a/base/allocator/partition_allocator/src/partition_alloc/partition_ref_count.h
  12. +++ b/base/allocator/partition_allocator/src/partition_alloc/partition_ref_count.h
  13. @@ -32,7 +32,7 @@ namespace partition_alloc::internal {
  14. // Aligns up (on 8B boundary) and returns `ref_count_size` if needed.
  15. // * Known to be needed on MacOS 13: https://crbug.com/1378822.
  16. -// * Thought to be needed on MacOS 14: https://crbug.com/1457756.
  17. +// * Thought to be needed on MacOS 14 and higher: https://crbug.com/1457756.
  18. // * No-op everywhere else.
  19. //
  20. // Placed outside `BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)`
  21. @@ -40,8 +40,7 @@ namespace partition_alloc::internal {
  22. // this gating.
  23. PA_ALWAYS_INLINE size_t AlignUpRefCountSizeForMac(size_t ref_count_size) {
  24. #if BUILDFLAG(IS_MAC)
  25. - if (internal::base::mac::MacOSMajorVersion() == 13 ||
  26. - internal::base::mac::MacOSMajorVersion() == 14) {
  27. + if (internal::base::mac::MacOSMajorVersion() >= 13) {
  28. return internal::base::bits::AlignUp<size_t>(ref_count_size, 8);
  29. }
  30. #endif // BUILDFLAG(IS_MAC)