From 5cbeb980882a19784dd1f2cd51a31e4732988776 Mon Sep 17 00:00:00 2001 From: cryptoforge Date: Mon, 9 Mar 2020 20:20:49 -0700 Subject: [PATCH] malloc_trim only on linux --- src/wallet/wallet.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 97db282a562..83339ed2b13 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -37,7 +37,9 @@ #include #include +#ifdef __linux__ //linux only #include +#endif using namespace std; using namespace libzcash; @@ -3069,9 +3071,11 @@ void CWallet::DeleteTransactions(std::vector &removeTxs) { return; } } - - // Miodrag: release memory back to the OS + + // Miodrag: release memory back to the OS, only works on linux + #ifdef __linux__ malloc_trim(0); + #endif } void CWallet::DeleteWalletTransactions(const CBlockIndex* pindex) {