diff --git a/cmake/flags.cmake b/cmake/flags.cmake index 3f2bd0a08..bc441dd03 100644 --- a/cmake/flags.cmake +++ b/cmake/flags.cmake @@ -34,7 +34,11 @@ if (CMAKE_CXX_COMPILER_ID MATCHES GNU) endif() if (WIN32) - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static") + if (CMAKE_SIZEOF_VOID_P EQUAL 8) + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static") + else() + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static -Wl,--large-address-aware") + endif() else() set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libgcc -static-libstdc++") endif() diff --git a/src/base/net/stratum/Job.cpp b/src/base/net/stratum/Job.cpp index a383bbf70..512b686ec 100644 --- a/src/base/net/stratum/Job.cpp +++ b/src/base/net/stratum/Job.cpp @@ -160,3 +160,20 @@ void xmrig::Job::setDiff(uint64_t diff) m_rawTarget[16] = '\0'; # endif } + + +void xmrig::Job::copy(const Job &other) +{ + m_algorithm = other.m_algorithm; + m_nicehash = other.m_nicehash; + m_size = other.m_size; + m_clientId = other.m_clientId; + m_id = other.m_id; + m_diff = other.m_diff; + m_height = other.m_height; + m_target = other.m_target; + m_index = other.m_index; + + memcpy(m_blob, other.m_blob, sizeof (m_blob)); + memcpy(m_seedHash, other.m_seedHash, sizeof(m_seedHash)); +} diff --git a/src/base/net/stratum/Job.h b/src/base/net/stratum/Job.h index 06d1be796..2b256a12f 100644 --- a/src/base/net/stratum/Job.h +++ b/src/base/net/stratum/Job.h @@ -90,10 +90,13 @@ public: inline bool operator==(const Job &other) const { return isEqual(other); } inline bool operator!=(const Job &other) const { return !isEqual(other); } + inline Job &operator=(const Job &other) { copy(other); return *this; } private: + void copy(const Job &other); + Algorithm m_algorithm; - bool m_nicehash = false; + bool m_nicehash = false; size_t m_size = 0; String m_clientId; String m_id;