Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(600)

Unified Diff: base/sys_byteorder.h

Issue 2518253002: Move Partition Allocator into Chromium base. (Closed)
Patch Set: Remove PRETTY_FUNCTION, and fix (?) ByteSwap for uintptr_t on macOS/iOS. Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: base/sys_byteorder.h
diff --git a/base/sys_byteorder.h b/base/sys_byteorder.h
index 8d9066c70228bfd7c36ec0cb3a2afe30dc006a2d..215184d9bf25f92bd70ff2197130666cf5cf3d2b 100644
--- a/base/sys_byteorder.h
+++ b/base/sys_byteorder.h
@@ -46,6 +46,14 @@ inline uint64_t ByteSwap(uint64_t x) {
#endif
}
+inline uintptr_t ByteSwapUintPtrT(uintptr_t x) {
gab 2016/12/06 15:43:21 Add a test to sys_byteorder_unittest.cc
palmer 2016/12/06 21:47:41 Done.
+#if defined(ARCH_CPU_64_BITS)
+ return ByteSwap(static_cast<uint64_t>(x));
+#else
gab 2016/12/06 15:43:21 Make this a #elif and have a #error Unsupported t
palmer 2016/12/06 21:47:41 Done.
+ return ByteSwap(static_cast<uint32_t>(x));
+#endif
+}
+
// Converts the bytes in |x| from host order (endianness) to little endian, and
// returns the result.
inline uint16_t ByteSwapToLE16(uint16_t x) {
« base/logging.h ('K') | « base/logging.h ('k') | docs/memory-infra/README.md » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698