mirror of
https://github.com/SChernykh/p2pool.git
synced 2024-11-16 15:57:39 +00:00
Small fixes
This commit is contained in:
parent
8a26498b66
commit
8e29abd906
3 changed files with 16 additions and 9 deletions
|
@ -117,19 +117,26 @@ FORCEINLINE static void remove_allocation(void* p)
|
|||
return;
|
||||
}
|
||||
}
|
||||
if (!found) {
|
||||
// Someone tried to deallocate a pointer that wasn't allocated before
|
||||
__debugbreak();
|
||||
|
||||
// Someone tried to deallocate a pointer that wasn't allocated before
|
||||
__debugbreak();
|
||||
}
|
||||
|
||||
FORCEINLINE static void* allocate_noexcept(size_t n) noexcept
|
||||
{
|
||||
void* p = malloc(n + sizeof(TrackedAllocation));
|
||||
if (p) {
|
||||
add_alocation(p, n);
|
||||
}
|
||||
return p;
|
||||
}
|
||||
|
||||
FORCEINLINE static void* allocate(size_t n)
|
||||
{
|
||||
void* p = malloc(n + sizeof(TrackedAllocation));
|
||||
void* p = allocate_noexcept(n);
|
||||
if (!p) {
|
||||
throw std::bad_alloc();
|
||||
}
|
||||
add_alocation(p, n);
|
||||
return p;
|
||||
}
|
||||
|
||||
|
@ -202,8 +209,8 @@ void memory_tracking_stop()
|
|||
|
||||
NOINLINE void* operator new(size_t n) { return p2pool::allocate(n); }
|
||||
NOINLINE void* operator new[](size_t n) { return p2pool::allocate(n); }
|
||||
NOINLINE void* operator new(size_t n, const std::nothrow_t&) noexcept { return p2pool::allocate(n); }
|
||||
NOINLINE void* operator new[](size_t n, const std::nothrow_t&) noexcept { return p2pool::allocate(n); }
|
||||
NOINLINE void* operator new(size_t n, const std::nothrow_t&) noexcept { return p2pool::allocate_noexcept(n); }
|
||||
NOINLINE void* operator new[](size_t n, const std::nothrow_t&) noexcept { return p2pool::allocate_noexcept(n); }
|
||||
NOINLINE void operator delete(void* p) noexcept { p2pool::deallocate(p); }
|
||||
NOINLINE void operator delete[](void* p) noexcept { p2pool::deallocate(p); }
|
||||
NOINLINE void operator delete(void* p, size_t) noexcept { p2pool::deallocate(p); }
|
||||
|
|
|
@ -657,7 +657,7 @@ void SideChain::print_status()
|
|||
"\nYour hashrate (est) = " << log::Hashrate(hashrate_est) <<
|
||||
"\nPPLNS window = " << total_blocks_in_window << " blocks (+" << total_uncles_in_window << " uncles, " << total_orphans << " orphans)"
|
||||
"\nYour shares = " << our_blocks_in_window << " blocks (+" << our_uncles_in_window << " uncles, " << our_orphans << " orphans)"
|
||||
"\nNext payout = " << log::XMRAmount(next_payout)
|
||||
"\nNext payout (est) = " << log::XMRAmount(next_payout)
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ public:
|
|||
struct Client;
|
||||
typedef Client* (*allocate_client_callback)();
|
||||
|
||||
TCPServer(allocate_client_callback allocate_new_client);
|
||||
explicit TCPServer(allocate_client_callback allocate_new_client);
|
||||
virtual ~TCPServer();
|
||||
|
||||
template<typename T>
|
||||
|
|
Loading…
Reference in a new issue