Code cleanup.

This commit is contained in:
XMRig 2020-10-16 19:35:36 +07:00
parent 5155139e9a
commit 36b1523194
No known key found for this signature in database
GPG key ID: 446A53638BE94409
8 changed files with 98 additions and 61 deletions

View file

@ -34,26 +34,27 @@
namespace xmrig {
static const char *kEnabled = "enabled";
static const char *kHugePages = "huge-pages";
static const char *kHugePagesJit = "huge-pages-jit";
static const char *kHwAes = "hw-aes";
static const char *kMaxThreadsHint = "max-threads-hint";
static const char *kMemoryPool = "memory-pool";
static const char *kPriority = "priority";
static const char *kYield = "yield";
const char *CpuConfig::kEnabled = "enabled";
const char *CpuConfig::kField = "cpu";
const char *CpuConfig::kHugePages = "huge-pages";
const char *CpuConfig::kHugePagesJit = "huge-pages-jit";
const char *CpuConfig::kHwAes = "hw-aes";
const char *CpuConfig::kMaxThreadsHint = "max-threads-hint";
const char *CpuConfig::kMemoryPool = "memory-pool";
const char *CpuConfig::kPriority = "priority";
const char *CpuConfig::kYield = "yield";
#ifdef XMRIG_FEATURE_ASM
static const char *kAsm = "asm";
const char *CpuConfig::kAsm = "asm";
#endif
#ifdef XMRIG_ALGO_ARGON2
static const char *kArgon2Impl = "argon2-impl";
const char *CpuConfig::kArgon2Impl = "argon2-impl";
#endif
#ifdef XMRIG_ALGO_ASTROBWT
static const char* kAstroBWTMaxSize = "astrobwt-max-size";
static const char* kAstroBWTAVX2 = "astrobwt-avx2";
const char *CpuConfig::kAstroBWTMaxSize = "astrobwt-max-size";
const char *CpuConfig::kAstroBWTAVX2 = "astrobwt-avx2";
#endif

View file

@ -44,6 +44,29 @@ public:
AES_SOFT
};
static const char *kEnabled;
static const char *kField;
static const char *kHugePages;
static const char *kHugePagesJit;
static const char *kHwAes;
static const char *kMaxThreadsHint;
static const char *kMemoryPool;
static const char *kPriority;
static const char *kYield;
# ifdef XMRIG_FEATURE_ASM
static const char *kAsm;
# endif
# ifdef XMRIG_ALGO_ARGON2
static const char *kArgon2Impl;
# endif
# ifdef XMRIG_ALGO_ASTROBWT
static const char *kAstroBWTMaxSize;
static const char *kAstroBWTAVX2;
# endif
CpuConfig() = default;
bool isHwAES() const;

View file

@ -49,7 +49,7 @@ public:
bool isEqual(const CpuLaunchData &other) const;
CnHash::AlgoVariant av() const;
inline constexpr static Nonce::Backend backend() { return Nonce::CPU; }
inline constexpr static Nonce::Backend backend() { return Nonce::CPU; }
inline bool operator!=(const CpuLaunchData &other) const { return !isEqual(other); }
inline bool operator==(const CpuLaunchData &other) const { return isEqual(other); }