mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-07-30 14:04:55 +00:00
fix clang
This commit is contained in:
parent
1057e5beef
commit
9f4e2e82c1
@ -541,31 +541,33 @@ int Pthread::SetAffinity(const Cpuset* cpuset) {
|
|||||||
return POSIX_ESRCH;
|
return POSIX_ESRCH;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* We don't use this currently because some games gets performance problems when applying affinity even on strong hardware
|
// We don't use this currently because some games gets performance problems
|
||||||
#ifdef _WIN64
|
// when applying affinity event
|
||||||
DWORD_PTR affinity_mask = static_cast<DWORD_PTR>(mask);
|
/*
|
||||||
if (!SetThreadAffinityMask(reinterpret_cast<HANDLE>(handle), affinity_mask)) {
|
#ifdef _WIN64
|
||||||
return POSIX_EINVAL;
|
DWORD_PTR affinity_mask = static_cast<DWORD_PTR>(mask);
|
||||||
}
|
if (!SetThreadAffinityMask(reinterpret_cast<HANDLE>(handle), affinity_mask)) {
|
||||||
|
return POSIX_EINVAL;
|
||||||
#elif defined(__linux__)
|
|
||||||
cpu_set_t cpu_set;
|
|
||||||
CPU_ZERO(&cpu_set);
|
|
||||||
|
|
||||||
u64 mask = cpuset->bits;
|
|
||||||
for (int cpu = 0; cpu < std::min(64, CPU_SETSIZE); ++cpu) {
|
|
||||||
if (mask & (1ULL << cpu)) {
|
|
||||||
CPU_SET(cpu, &cpu_set);
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
int result =
|
#elif defined(__linux__)
|
||||||
pthread_setaffinity_np(static_cast<pthread_t>(handle), sizeof(cpu_set_t), &cpu_set);
|
cpu_set_t cpu_set;
|
||||||
if (result != 0) {
|
CPU_ZERO(&cpu_set);
|
||||||
return POSIX_EINVAL;
|
|
||||||
}
|
u64 mask = cpuset->bits;
|
||||||
#endif
|
for (int cpu = 0; cpu < std::min(64, CPU_SETSIZE); ++cpu) {
|
||||||
*/
|
if (mask & (1ULL << cpu)) {
|
||||||
|
CPU_SET(cpu, &cpu_set);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
int result =
|
||||||
|
pthread_setaffinity_np(static_cast<pthread_t>(handle), sizeof(cpu_set_t), &cpu_set);
|
||||||
|
if (result != 0) {
|
||||||
|
return POSIX_EINVAL;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
*/
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user