mirror of
https://github.com/xmrig/xmrig.git
synced 2025-01-09 20:39:27 +00:00
Fix --cpu-affinity overflow, again.
This commit is contained in:
parent
f36b5eeaad
commit
14c6f8699e
3 changed files with 6 additions and 3 deletions
|
@ -25,6 +25,9 @@
|
|||
#define __CPU_H__
|
||||
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
|
||||
class Cpu
|
||||
{
|
||||
public:
|
||||
|
@ -36,7 +39,7 @@ public:
|
|||
|
||||
static int optimalThreadsCount(int algo, bool doubleHash, int maxCpuUsage);
|
||||
static void init();
|
||||
static void setAffinity(int id, unsigned long mask);
|
||||
static void setAffinity(int id, uint64_t mask);
|
||||
|
||||
static inline bool hasAES() { return m_flags & AES; }
|
||||
static inline bool isX64() { return m_flags & X86_64; }
|
||||
|
|
|
@ -40,7 +40,7 @@ void Cpu::init()
|
|||
}
|
||||
|
||||
|
||||
void Cpu::setAffinity(int id, unsigned long mask)
|
||||
void Cpu::setAffinity(int id, uint64_t mask)
|
||||
{
|
||||
cpu_set_t set;
|
||||
CPU_ZERO(&set);
|
||||
|
|
|
@ -41,7 +41,7 @@ void Cpu::init()
|
|||
}
|
||||
|
||||
|
||||
void Cpu::setAffinity(int id, unsigned long mask)
|
||||
void Cpu::setAffinity(int id, uint64_t mask)
|
||||
{
|
||||
if (id == -1) {
|
||||
SetProcessAffinityMask(GetCurrentProcess(), mask);
|
||||
|
|
Loading…
Reference in a new issue