From f65e63fafa1844c5c6937c9c90e285058eed20f4 Mon Sep 17 00:00:00 2001 From: David Date: Sun, 11 Oct 2026 09:50:41 +0200 Subject: [PATCH] test(libSceJobManager): allocate aligned test blocks without std::aligned_alloc MinGW-w64's UCRT has no aligned_alloc, so the Windows build of guest_job_manager_tests fails since #3170. Use the aligned operator new and delete instead, which are standard C++17 on every host. Co-Authored-By: Claude Fable 5.1 --- core/libs/tests/GuestJobManager.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/libs/tests/GuestJobManager.cpp b/core/libs/tests/GuestJobManager.cpp index 0dca62187..e82703be1 100644 --- a/core/libs/tests/GuestJobManager.cpp +++ b/core/libs/tests/GuestJobManager.cpp @@ -4,6 +4,7 @@ #include #include #include +#include #include #include #include @@ -97,8 +98,8 @@ static void Check(bool value, int line) { #define Require(value) Check((value), __LINE__) struct Block { - explicit Block(std::uint64_t size) : bytes(size), memory(std::aligned_alloc(256, (size + 255) & ~std::uint64_t{255})) {} - ~Block() { std::free(memory); } + explicit Block(std::uint64_t size) : bytes(size), memory(::operator new((size + 255) & ~std::uint64_t{255}, std::align_val_t{256})) {} + ~Block() { ::operator delete(memory, std::align_val_t{256}); } std::uint64_t bytes; void* memory; };