From 342a6a8e111c1b94d4516ab87ec9ca12e3159c0e Mon Sep 17 00:00:00 2001 From: Peter Varga Date: Tue, 15 Nov 2022 13:25:20 +0100 Subject: [Backport] [PA] PA_YIELD_PROCESSOR for MSVC This CL works around MSVC not liking inline assembly and replaces it with an MSVC macro. Bug: 1351310 Change-Id: I7c145248feffa1a2a13cc5127e875e24ded13cba Review-URL: https://chromium-review.googlesource.com/c/chromium/src/+/3852891 Cr-Commit-Position: refs/heads/main@{#1038712} Reviewed-on: https://codereview.qt-project.org/c/qt/qtwebengine-chromium/+/443563 Reviewed-by: Allan Sandfeld Jensen --- chromium/base/allocator/partition_allocator/yield_processor.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/chromium/base/allocator/partition_allocator/yield_processor.h b/chromium/base/allocator/partition_allocator/yield_processor.h index 78256de0ed0..c97e16a20f9 100644 --- a/chromium/base/allocator/partition_allocator/yield_processor.h +++ b/chromium/base/allocator/partition_allocator/yield_processor.h @@ -16,6 +16,10 @@ #if BUILDFLAG(IS_NACL) // Inline assembly not allowed. #define PA_YIELD_PROCESSOR ((void)0) +#elif defined(COMPILER_MSVC) && !defined(__clang__) +// MSVC is in its own assemblyless world (crbug.com/1351310#c6). +#include +#define PA_YIELD_PROCESSOR (YieldProcessor()) #else #if defined(COMPILER_MSVC) -- cgit v1.2.1