Skip to content

Commit

Permalink
Merge xmrig v6.21.3
Browse files Browse the repository at this point in the history
  • Loading branch information
MoneroOcean committed Apr 26, 2024
2 parents b14fcf3 + 7897f10 commit 9d537fc
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 15 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,6 @@
# v6.21.3
- [#3462](https://github.com/xmrig/xmrig/pull/3462) RandomX: correct memcpy size for JIT initialization.

# v6.21.2
- The dependencies of all prebuilt releases have been updated. Support for old Ubuntu releases has been dropped.
- [#2800](https://github.com/xmrig/xmrig/issues/2800) Fixed donation with GhostRider algorithm for builds without KawPow algorithm.
Expand Down
13 changes: 7 additions & 6 deletions src/base/api/Api.cpp
@@ -1,6 +1,6 @@
/* XMRig
* Copyright (c) 2018-2023 SChernykh <https://github.com/SChernykh>
* Copyright (c) 2016-2023 XMRig <https://github.com/xmrig>, <support@xmrig.com>
* Copyright (c) 2018-2024 SChernykh <https://github.com/SChernykh>
* Copyright (c) 2016-2024 XMRig <https://github.com/xmrig>, <support@xmrig.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand All @@ -25,6 +25,8 @@
#include "base/crypto/keccak.h"
#include "base/io/Env.h"
#include "base/io/json/Json.h"
#include "base/io/log/Log.h"
#include "base/io/log/Tags.h"
#include "base/kernel/Base.h"
#include "base/tools/Chrono.h"
#include "base/tools/Cvt.h"
Expand All @@ -39,7 +41,6 @@


#include <thread>
#include <iostream>


namespace xmrig {
Expand Down Expand Up @@ -81,8 +82,7 @@ static rapidjson::Value getResources(rapidjson::Document &doc)

xmrig::Api::Api(Base *base) :
m_base(base),
m_timestamp(Chrono::currentMSecsSinceEpoch()),
m_httpd(nullptr)
m_timestamp(Chrono::currentMSecsSinceEpoch())
{
base->addListener(this);

Expand Down Expand Up @@ -118,7 +118,8 @@ void xmrig::Api::start()
if (!m_httpd) {
m_httpd = new Httpd(m_base);
if (!m_httpd->start()) {
std::cerr << "HTTP server failed to start." << std::endl;
LOG_ERR("%s " RED_BOLD("HTTP API server failed to start."), Tags::network());

delete m_httpd; // Properly handle failure to start
m_httpd = nullptr;
}
Expand Down
4 changes: 2 additions & 2 deletions src/base/api/Api.h
@@ -1,6 +1,6 @@
/* XMRig
* Copyright (c) 2018-2023 SChernykh <https://github.com/SChernykh>
* Copyright (c) 2016-2023 XMRig <https://github.com/xmrig>, <support@xmrig.com>
* Copyright (c) 2018-2024 SChernykh <https://github.com/SChernykh>
* Copyright (c) 2016-2024 XMRig <https://github.com/xmrig>, <support@xmrig.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion src/crypto/randomx/jit_compiler_a64.cpp
Expand Up @@ -1078,6 +1078,6 @@ void JitCompilerA64::h_NOP(Instruction& instr, uint32_t& codePos)
{
}

InstructionGeneratorA64 JitCompilerA64::engine[257] = {};
InstructionGeneratorA64 JitCompilerA64::engine[256] = {};

}
2 changes: 1 addition & 1 deletion src/crypto/randomx/jit_compiler_a64.hpp
Expand Up @@ -74,7 +74,7 @@ namespace randomx {
void enableWriting() const;
void enableExecution() const;

static InstructionGeneratorA64 engine[257];
static InstructionGeneratorA64 engine[256];

private:
const bool hugePages;
Expand Down
2 changes: 1 addition & 1 deletion src/crypto/randomx/jit_compiler_x86.cpp
Expand Up @@ -1456,6 +1456,6 @@ namespace randomx {
emitByte(0x90, code, codePos);
}

alignas(64) InstructionGeneratorX86 JitCompilerX86::engine[257] = {};
alignas(64) InstructionGeneratorX86 JitCompilerX86::engine[256] = {};

}
2 changes: 1 addition & 1 deletion src/crypto/randomx/jit_compiler_x86.hpp
Expand Up @@ -81,7 +81,7 @@ namespace randomx {
void enableWriting() const;
void enableExecution() const;

alignas(64) static InstructionGeneratorX86 engine[257];
alignas(64) static InstructionGeneratorX86 engine[256];

private:
int registerUsage[RegistersCount] = {};
Expand Down
2 changes: 1 addition & 1 deletion src/crypto/randomx/randomx.cpp
Expand Up @@ -301,7 +301,7 @@ typedef void(randomx::JitCompilerX86::* InstructionGeneratorX86_2)(const randomx

#define JIT_HANDLE(x, prev) do { \
const InstructionGeneratorX86_2 p = &randomx::JitCompilerX86::h_##x; \
memcpy(randomx::JitCompilerX86::engine + k, &p, sizeof(p)); \
memcpy(randomx::JitCompilerX86::engine + k, &p, sizeof(randomx::JitCompilerX86::engine[k])); \
} while (0)

#elif (XMRIG_ARM == 8)
Expand Down
4 changes: 2 additions & 2 deletions src/version.h
Expand Up @@ -22,15 +22,15 @@
#define APP_ID "xmrig"
#define APP_NAME "XMRig"
#define APP_DESC "XMRig miner"
#define APP_VERSION "6.21.2-mo1"
#define APP_VERSION "6.21.3-mo1"
#define APP_DOMAIN "xmrig.com"
#define APP_SITE "www.xmrig.com"
#define APP_COPYRIGHT "Copyright (C) 2016-2024 xmrig.com"
#define APP_KIND "miner"

#define APP_VER_MAJOR 6
#define APP_VER_MINOR 21
#define APP_VER_PATCH 2
#define APP_VER_PATCH 3

#ifdef _MSC_VER
# if (_MSC_VER >= 1930)
Expand Down

0 comments on commit 9d537fc

Please sign in to comment.