diff --git a/src/common.h b/src/common.h index fcbe3cd..aaf0bc3 100644 --- a/src/common.h +++ b/src/common.h @@ -81,6 +81,14 @@ #endif +#ifndef __has_feature + #define __has_feature(x) 0 +#endif + +#if defined(_DEBUG) || defined(__SANITIZE_ADDRESS__) || __has_feature(address_sanitizer) || defined(__SANITIZE_THREAD__) || __has_feature(thread_sanitizer) +#define P2POOL_DEBUGGING 1 +#endif + namespace p2pool { constexpr size_t HASH_SIZE = 32; diff --git a/src/side_chain.cpp b/src/side_chain.cpp index fa013f0..97dba759 100644 --- a/src/side_chain.cpp +++ b/src/side_chain.cpp @@ -171,7 +171,8 @@ SideChain::SideChain(p2pool* pool, NetworkType type, const char* pool_name) // Use between 1 and 8 threads if (numThreads < 1) numThreads = 1; -#ifndef _DEBUG + // Don't limit thread count when debugging because debug builds are slow +#ifndef P2POOL_DEBUGGING if (numThreads > 8) numThreads = 8; #endif