Added memory hooks for CURL

This commit is contained in:
SChernykh
2022-06-07 16:02:08 +02:00
parent 75b9a0228b
commit 8b681d6efb
5 changed files with 33 additions and 13 deletions

View File

@@ -20,6 +20,7 @@
#include "p2pool.h"
#include "stratum_server.h"
#include "p2p_server.h"
#include <curl/curl.h>
void p2pool_usage()
{
@@ -81,12 +82,15 @@ int main(int argc, char* argv[])
}
}
int result;
memory_tracking_start();
p2pool::init_crypto_cache();
int result = static_cast<int>(curl_global_init_mem(CURL_GLOBAL_ALL, p2pool::malloc_hook, p2pool::free_hook, p2pool::realloc_hook, p2pool::strdup_hook, p2pool::calloc_hook));
if (result != CURLE_OK) {
return result;
}
try {
p2pool::p2pool pool(argc, argv);
result = pool.run();
@@ -95,6 +99,8 @@ int main(int argc, char* argv[])
result = 1;
}
curl_global_cleanup();
p2pool::destroy_crypto_cache();
memory_tracking_stop();