Differential D18757 Diff 52594 www/qt5-webengine/files/patch-src_3rdparty_chromium_base_allocator_allocator__shim__unittest.cc
Changeset View
Changeset View
Standalone View
Standalone View
www/qt5-webengine/files/patch-src_3rdparty_chromium_base_allocator_allocator__shim__unittest.cc
--- src/3rdparty/chromium/base/allocator/allocator_shim_unittest.cc.orig 2017-01-26 00:49:07 UTC | --- src/3rdparty/chromium/base/allocator/allocator_shim_unittest.cc.orig 2018-11-13 18:25:11 UTC | ||||
+++ src/3rdparty/chromium/base/allocator/allocator_shim_unittest.cc | +++ src/3rdparty/chromium/base/allocator/allocator_shim_unittest.cc | ||||
@@ -4,7 +4,6 @@ | @@ -29,7 +29,7 @@ | ||||
#include "base/allocator/allocator_interception_mac.h" | |||||
#include "base/mac/mac_util.h" | |||||
#include "third_party/apple_apsl/malloc.h" | |||||
-#else | |||||
+#elif !defined(OS_BSD) | |||||
#include <malloc.h> | |||||
#endif | |||||
#include "base/allocator/allocator_shim.h" | @@ -294,7 +294,7 @@ TEST_F(AllocatorShimTest, InterceptLibcSymbols) { | ||||
ASSERT_GE(aligned_allocs_intercepted_by_size[61], 1u); | |||||
#endif // !OS_WIN | |||||
-#include <malloc.h> | -#if !defined(OS_WIN) && !defined(OS_MACOSX) | ||||
#include <stdlib.h> | +#if !defined(OS_WIN) && !defined(OS_MACOSX) && !defined(OS_BSD) | ||||
#include <string.h> | |||||
@@ -193,11 +192,13 @@ TEST_F(AllocatorShimTest, InterceptLibcS | |||||
ASSERT_GE(zero_allocs_intercepted_by_size[2 * 23], 1u); | |||||
#if !defined(OS_WIN) | |||||
+#if !defined(OS_BSD) | |||||
void* memalign_ptr = memalign(128, 53); | void* memalign_ptr = memalign(128, 53); | ||||
ASSERT_NE(nullptr, memalign_ptr); | ASSERT_NE(nullptr, memalign_ptr); | ||||
ASSERT_EQ(0u, reinterpret_cast<uintptr_t>(memalign_ptr) % 128); | ASSERT_EQ(0u, reinterpret_cast<uintptr_t>(memalign_ptr) % 128); | ||||
ASSERT_GE(aligned_allocs_intercepted_by_alignment[128], 1u); | @@ -307,7 +307,7 @@ TEST_F(AllocatorShimTest, InterceptLibcSymbols) { | ||||
ASSERT_GE(aligned_allocs_intercepted_by_size[53], 1u); | |||||
+#endif | |||||
void* posix_memalign_ptr = nullptr; | |||||
int res = posix_memalign(&posix_memalign_ptr, 256, 59); | |||||
@@ -214,12 +215,14 @@ TEST_F(AllocatorShimTest, InterceptLibcS | |||||
ASSERT_GE(aligned_allocs_intercepted_by_alignment[kPageSize], 1u); | ASSERT_GE(aligned_allocs_intercepted_by_alignment[kPageSize], 1u); | ||||
ASSERT_GE(aligned_allocs_intercepted_by_size[61], 1u); | |||||
+#if !defined(OS_BSD) | |||||
void* pvalloc_ptr = pvalloc(67); | |||||
ASSERT_NE(nullptr, pvalloc_ptr); | |||||
ASSERT_EQ(0u, reinterpret_cast<uintptr_t>(pvalloc_ptr) % kPageSize); | |||||
ASSERT_GE(aligned_allocs_intercepted_by_alignment[kPageSize], 1u); | |||||
// pvalloc rounds the size up to the next page. | // pvalloc rounds the size up to the next page. | ||||
ASSERT_GE(aligned_allocs_intercepted_by_size[kPageSize], 1u); | ASSERT_GE(aligned_allocs_intercepted_by_size[kPageSize], 1u); | ||||
+#endif | -#endif // !OS_WIN && !OS_MACOSX | ||||
#endif // OS_WIN | +#endif // !OS_WIN && !OS_MACOSX && !defined(OS_BSD) | ||||
char* realloc_ptr = static_cast<char*>(realloc(nullptr, 71)); | char* realloc_ptr = static_cast<char*>(malloc(10)); | ||||
@@ -240,8 +243,10 @@ TEST_F(AllocatorShimTest, InterceptLibcS | strcpy(realloc_ptr, "foobar"); | ||||
@@ -323,13 +323,13 @@ TEST_F(AllocatorShimTest, InterceptLibcSymbols) { | |||||
free(zero_alloc_ptr); | |||||
ASSERT_GE(frees_intercepted_by_addr[Hash(zero_alloc_ptr)], 1u); | ASSERT_GE(frees_intercepted_by_addr[Hash(zero_alloc_ptr)], 1u); | ||||
#if !defined(OS_WIN) | -#if !defined(OS_WIN) && !defined(OS_MACOSX) | ||||
+#if !defined(OS_BSD) | +#if !defined(OS_WIN) && !defined(OS_MACOSX) && !defined(OS_BSD) | ||||
free(memalign_ptr); | free(memalign_ptr); | ||||
ASSERT_GE(frees_intercepted_by_addr[Hash(memalign_ptr)], 1u); | ASSERT_GE(frees_intercepted_by_addr[Hash(memalign_ptr)], 1u); | ||||
+#endif | |||||
free(posix_memalign_ptr); | |||||
ASSERT_GE(frees_intercepted_by_addr[Hash(posix_memalign_ptr)], 1u); | |||||
@@ -249,8 +254,10 @@ TEST_F(AllocatorShimTest, InterceptLibcS | |||||
free(valloc_ptr); | |||||
ASSERT_GE(frees_intercepted_by_addr[Hash(valloc_ptr)], 1u); | |||||
+#if !defined(OS_BSD) | |||||
free(pvalloc_ptr); | free(pvalloc_ptr); | ||||
ASSERT_GE(frees_intercepted_by_addr[Hash(pvalloc_ptr)], 1u); | ASSERT_GE(frees_intercepted_by_addr[Hash(pvalloc_ptr)], 1u); | ||||
+#endif | -#endif // !OS_WIN && !OS_MACOSX | ||||
#endif // OS_WIN | +#endif // !OS_WIN && !OS_MACOSX && !defined(OS_BSD) | ||||
free(realloc_ptr); | #if !defined(OS_WIN) | ||||
free(posix_memalign_ptr); |