Merge remote-tracking branch 'origin/master' into dev_tls
This commit is contained in:
commit
c5fa48215b
7 changed files with 11 additions and 7 deletions
|
@ -16,8 +16,6 @@ include (CheckIncludeFile)
|
|||
include (cmake/cpu.cmake)
|
||||
|
||||
set(SOURCES
|
||||
src/api/Api.cpp
|
||||
src/api/ApiState.cpp
|
||||
src/api/NetworkState.cpp
|
||||
src/App.cpp
|
||||
src/net/Client.cpp
|
||||
|
@ -61,6 +59,8 @@ set(SOURCES_COMMON
|
|||
if (WIN32)
|
||||
set(SOURCES_OS
|
||||
res/app.rc
|
||||
src/api/Api.cpp
|
||||
src/api/ApiState.cpp
|
||||
src/App_win.cpp
|
||||
src/Cpu_win.cpp
|
||||
src/Mem_win.cpp
|
||||
|
@ -78,6 +78,8 @@ elseif (APPLE)
|
|||
)
|
||||
else()
|
||||
set(SOURCES_OS
|
||||
src/api/Api.cpp
|
||||
src/api/ApiState.cpp
|
||||
src/App_unix.cpp
|
||||
src/Cpu_unix.cpp
|
||||
src/Mem_unix.cpp
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
|
||||
|
||||
#include "Cpu.h"
|
||||
|
||||
#include "CpuImpl.h"
|
||||
|
||||
void CpuImpl::init()
|
||||
{
|
||||
|
|
|
@ -59,7 +59,7 @@ void CpuImpl::setAffinity(int id, uint64_t mask)
|
|||
cpu_set_t set;
|
||||
CPU_ZERO(&set);
|
||||
|
||||
for (int i = 0; i < threads(); i++) {
|
||||
for (size_t i = 0; i < threads(); i++) {
|
||||
if (mask & (1UL << i)) {
|
||||
CPU_SET(i, &set);
|
||||
}
|
||||
|
|
|
@ -47,7 +47,7 @@ bool Mem::allocate(const Options* options)
|
|||
m_memorySize = 0;
|
||||
|
||||
size_t scratchPadSize = m_algo == Options::ALGO_CRYPTONIGHT ? MEMORY : MEMORY_LITE;
|
||||
for (int i=0; i < m_threads; i++) {
|
||||
for (size_t i=0; i < m_threads; i++) {
|
||||
m_memorySize += sizeof(cryptonight_ctx);
|
||||
m_memorySize += scratchPadSize * getThreadHashFactor(i);
|
||||
}
|
||||
|
@ -60,6 +60,7 @@ bool Mem::allocate(const Options* options)
|
|||
m_flags |= HugepagesAvailable;
|
||||
|
||||
# if defined(__APPLE__)
|
||||
m_memorySize = m_memorySize - (m_memorySize % MEMORY) + MEMORY;
|
||||
m_memory = static_cast<uint8_t*>(mmap(0, m_memorySize, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON, VM_FLAGS_SUPERPAGE_SIZE_2MB, 0));
|
||||
# elif defined(__FreeBSD__)
|
||||
m_memory = static_cast<uint8_t*>(mmap(0, m_memorySize, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS | MAP_ALIGNED_SUPER | MAP_PREFAULT_READ, -1, 0));
|
||||
|
|
|
@ -104,7 +104,7 @@ static void print_threads()
|
|||
threads.append(std::to_string(id));
|
||||
};
|
||||
|
||||
for (int i=0; i < Options::i()->threads(); i++) {
|
||||
for (size_t i=0; i < Options::i()->threads(); i++) {
|
||||
if (Mem::getThreadHashFactor(i) > 1) {
|
||||
addThread(multiThreads, i);
|
||||
}
|
||||
|
|
|
@ -33,6 +33,7 @@
|
|||
#include <thread>
|
||||
#else
|
||||
#include <sys/wait.h>
|
||||
#include <errno.h>
|
||||
#endif
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
|
|
|
@ -68,7 +68,7 @@
|
|||
# endif
|
||||
#include <string>
|
||||
#else
|
||||
#if defined(__FreeBSD__)
|
||||
#if defined(__FreeBSD__) || defined(__APPLE__)
|
||||
#include <string>
|
||||
#else
|
||||
#include <string.h>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue