1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-04-30 08:43:09 +00:00

Fix GetProcessGroupAffinity call

`GetProcessGroupAffinity` appears to require 4 byte alignment for `GroupArray` memory.

See https://stackoverflow.com/q/78567676 for further information

closes https://github.com/official-stockfish/Stockfish/pull/5340

No functional change
This commit is contained in:
Tomasz Sobczyk 2024-06-02 20:39:25 +02:00 committed by Joost VandeVondele
parent 8aaae0367c
commit a2a7edf4c8

View file

@ -774,7 +774,7 @@ class NumaConfig {
// We are expecting a single group. // We are expecting a single group.
USHORT GroupCount = 1; USHORT GroupCount = 1;
USHORT GroupArray[1]; alignas(4) USHORT GroupArray[1];
status = GetProcessGroupAffinity_f(GetCurrentProcess(), &GroupCount, GroupArray); status = GetProcessGroupAffinity_f(GetCurrentProcess(), &GroupCount, GroupArray);
if (status == 0 || GroupCount != 1) if (status == 0 || GroupCount != 1)
return std::nullopt; return std::nullopt;