1
0
mirror of https://github.com/xmrig/xmrig.git synced 2025-12-11 17:32:47 -05:00

replace new/delete with sp

This commit is contained in:
4ertus2
2024-10-20 08:24:09 +03:00
parent e32731b60b
commit ab5be0b773
71 changed files with 271 additions and 387 deletions

View File

@@ -38,17 +38,6 @@ std::mutex KPCache::s_cacheMutex;
KPCache KPCache::s_cache;
KPCache::KPCache()
{
}
KPCache::~KPCache()
{
delete m_memory;
}
bool KPCache::init(uint32_t epoch)
{
if (epoch >= sizeof(cache_sizes) / sizeof(cache_sizes[0])) {
@@ -63,8 +52,7 @@ bool KPCache::init(uint32_t epoch)
const size_t size = cache_sizes[epoch];
if (!m_memory || m_memory->size() < size) {
delete m_memory;
m_memory = new VirtualMemory(size, false, false, false);
m_memory = std::make_shared<VirtualMemory>(size, false, false, false);
}
const ethash_h256_t seedhash = ethash_get_seedhash(epoch);