Added macro for debug builds

pull/226/head
SChernykh 2022-10-13 11:21:40 +02:00
parent a917a9493c
commit c029e5c39d
2 changed files with 10 additions and 1 deletions

View File

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

View File

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