Move Profiler and more cleanup.

This commit is contained in:
XMRig 2020-12-04 09:23:40 +07:00
parent 662a957106
commit c8ee6f7db8
No known key found for this signature in database
GPG key ID: 446A53638BE94409
30 changed files with 123 additions and 256 deletions

View file

@ -1,14 +1,7 @@
/* XMRig
* Copyright 2010 Jeff Garzik <jgarzik@pobox.com>
* Copyright 2012-2014 pooler <pooler@litecoinpool.org>
* Copyright 2014 Lucas Jones <https://github.com/lucasjones>
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
* Copyright 2017-2019 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
* Copyright 2018 Lee Clagett <https://github.com/vtnerd>
* Copyright 2018-2019 tevador <tevador@gmail.com>
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
* Copyright (c) 2018-2019 tevador <tevador@gmail.com>
* Copyright (c) 2018-2020 SChernykh <https://github.com/SChernykh>
* Copyright (c) 2016-2020 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
@ -28,12 +21,10 @@
#define XMRIG_RX_DATASET_H
#include "base/crypto/Algorithm.h"
#include "base/tools/Buffer.h"
#include "base/tools/Object.h"
#include "crypto/common/HugePagesInfo.h"
#include "crypto/randomx/configuration.h"
#include "crypto/randomx/randomx.h"
#include "crypto/rx/RxConfig.h"
#include <atomic>
@ -68,11 +59,10 @@ public:
bool isOneGbPages() const;
HugePagesInfo hugePages(bool cache = true) const;
size_t size(bool cache = true) const;
uint8_t *tryAllocateScrathpad();
void *raw() const;
void setRaw(const void *raw);
uint8_t *tryAllocateScrathpad();
static inline constexpr size_t maxSize() { return RANDOMX_DATASET_MAX_SIZE; }
private:
@ -82,10 +72,9 @@ private:
const uint32_t m_node;
randomx_dataset *m_dataset = nullptr;
RxCache *m_cache = nullptr;
VirtualMemory *m_memory = nullptr;
std::atomic<size_t> m_scratchpadOffset;
size_t m_scratchpadLimit = 0;
std::atomic<size_t> m_scratchpadOffset{};
VirtualMemory *m_memory = nullptr;
};