Fix --cpu-affinity overflow, again.

This commit is contained in:
XMRig 2017-06-27 18:47:33 +03:00
parent f36b5eeaad
commit 14c6f8699e
3 changed files with 6 additions and 3 deletions

View file

@ -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; }

View file

@ -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);

View file

@ -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);