mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-23 18:46:59 +08: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:
committed by
Joost VandeVondele
parent
8aaae0367c
commit
a2a7edf4c8
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user