Move Partition Allocator into Chromium base.
This will enable more parts of Chromium to use PA, and will make it easier for things outside of Chromium (e.g. PDFium) to use PA.
This change is intended to be merely a move, and should not have significant performance impact.
This moves only the core of PA; higher API layers that Blink uses to call into PA remain in Blink.
BUG=632441
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Review-Url: https://codereview.chromium.org/2518253002
Cr-Commit-Position: refs/heads/master@{#438471}
CrOS-Libchrome-Original-Commit: a988c5022f9bc4fb75ac0b86dda8005ee57ff357
diff --git a/base/sys_byteorder_unittest.cc b/base/sys_byteorder_unittest.cc
index 0352c2a..8167be3 100644
--- a/base/sys_byteorder_unittest.cc
+++ b/base/sys_byteorder_unittest.cc
@@ -6,6 +6,7 @@
#include <stdint.h>
+#include "build/build_config.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace {
@@ -40,6 +41,25 @@
EXPECT_EQ(k64BitTestData, reswapped);
}
+TEST(ByteOrderTest, ByteSwapUintPtrT) {
+#if defined(ARCH_CPU_64_BITS)
+ const uintptr_t test_data = static_cast<uintptr_t>(k64BitTestData);
+ const uintptr_t swapped_test_data =
+ static_cast<uintptr_t>(k64BitSwappedTestData);
+#elif defined(ARCH_CPU_32_BITS)
+ const uintptr_t test_data = static_cast<uintptr_t>(k32BitTestData);
+ const uintptr_t swapped_test_data =
+ static_cast<uintptr_t>(k32BitSwappedTestData);
+#else
+#error architecture not supported
+#endif
+
+ uintptr_t swapped = base::ByteSwapUintPtrT(test_data);
+ EXPECT_EQ(swapped_test_data, swapped);
+ uintptr_t reswapped = base::ByteSwapUintPtrT(swapped);
+ EXPECT_EQ(test_data, reswapped);
+}
+
TEST(ByteOrderTest, ByteSwapToLE16) {
uint16_t le = base::ByteSwapToLE16(k16BitTestData);
#if defined(ARCH_CPU_LITTLE_ENDIAN)