ayaports/backports/electron/pvalloc.patch

34 lines
1.4 KiB
Diff
Raw Normal View History

2024-06-02 23:02:17 +00:00
the pvalloc/valloc symbols are obsolete and not implemented in musl
--
--- a/base/allocator/partition_allocator/src/partition_alloc/shim/allocator_shim_unittest.cc
+++ b/base/allocator/partition_allocator/src/partition_alloc/shim/allocator_shim_unittest.cc
2024-11-01 13:59:14 +00:00
@@ -410,7 +410,7 @@
2024-06-02 23:02:17 +00:00
ASSERT_GE(aligned_allocs_intercepted_by_alignment[128], 1u);
ASSERT_GE(aligned_allocs_intercepted_by_size[53], 1u);
2024-11-01 13:59:14 +00:00
-#if PA_BUILDFLAG(IS_POSIX) && !PA_BUILDFLAG(IS_ANDROID)
+#if (PA_BUILDFLAG(IS_POSIX) && defined(__GLIBC__)) && !PA_BUILDFLAG(IS_ANDROID)
2024-06-02 23:02:17 +00:00
void* pvalloc_ptr = pvalloc(67);
ASSERT_NE(nullptr, pvalloc_ptr);
ASSERT_EQ(0u, reinterpret_cast<uintptr_t>(pvalloc_ptr) % kPageSize);
2024-11-01 13:59:14 +00:00
@@ -449,7 +449,7 @@
2024-06-02 23:02:17 +00:00
free(memalign_ptr);
ASSERT_GE(frees_intercepted_by_addr[Hash(memalign_ptr)], 1u);
2024-11-01 13:59:14 +00:00
-#if PA_BUILDFLAG(IS_POSIX) && !PA_BUILDFLAG(IS_ANDROID)
+#if (PA_BUILDFLAG(IS_POSIX) && defined(__GLIBC__)) && !PA_BUILDFLAG(IS_ANDROID)
2024-06-02 23:02:17 +00:00
free(pvalloc_ptr);
ASSERT_GE(frees_intercepted_by_addr[Hash(pvalloc_ptr)], 1u);
2024-11-01 13:59:14 +00:00
#endif // PA_BUILDFLAG(IS_POSIX) && !PA_BUILDFLAG(IS_ANDROID)
2024-06-02 23:02:17 +00:00
--- a/base/process/memory_unittest.cc
+++ b/base/process/memory_unittest.cc
@@ -359,7 +359,7 @@
#endif // BUILDFLAG(IS_WIN)
#endif // !BUILDFLAG(IS_MAC)
-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
+#if (BUILDFLAG(IS_LINUX) && defined(__GLIBC__)) || BUILDFLAG(IS_CHROMEOS)
TEST_F(OutOfMemoryDeathTest, Valloc) {
ASSERT_OOM_DEATH({