From 2f9340b9371522954791e7c7d2f9c6c4087508fd Mon Sep 17 00:00:00 2001 From: Green Sky Date: Tue, 22 Aug 2023 21:13:09 +0200 Subject: [PATCH] remap file after completion, clears ram --- solanaceae/ngc_ft1_sha1/sha1_ngcft1.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/solanaceae/ngc_ft1_sha1/sha1_ngcft1.cpp b/solanaceae/ngc_ft1_sha1/sha1_ngcft1.cpp index a9c3e05..2ba189a 100644 --- a/solanaceae/ngc_ft1_sha1/sha1_ngcft1.cpp +++ b/solanaceae/ngc_ft1_sha1/sha1_ngcft1.cpp @@ -951,6 +951,14 @@ bool SHA1_NGCFT1::onEvent(const Events::NGCFT1_recv_done& e) { cc.have_all = true; cc.have_chunk.clear(); // not wasting memory std::cout << "SHA1_NGCFT1: got all chunks for \n" << info << "\n"; + + // HACK: remap file, to clear ram + + // TODO: error checking + ce.get() = std::make_unique( + ce.get().file_list.front(), + info.file_size + ); } // good chunk