File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed
Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -1252,6 +1252,7 @@ template <unsigned SIZE> KMC::Stage1Results CKMC<SIZE>::ProcessStage1_impl()
12521252
12531253 buildSignatureMapping ();
12541254
1255+ Queues.pmm_binary_file_reader ->forget (); // seems there is a bug and not all parts get free during signature map building
12551256 // ***** Stage 1 *****
12561257
12571258 if (Params.file_type != InputType::BAM)
Original file line number Diff line number Diff line change @@ -897,6 +897,15 @@ class CMemoryPool {
897897 stack[i] = i;
898898 }
899899
900+ // Forgets about every allocation
901+ // After this pool may be reused like a new one, but this avoids reallocations
902+ void forget () {
903+ unique_lock<mutex> lck (mtx);
904+ n_parts_free = n_parts_total;
905+ for (uint32 i = 0 ; i < n_parts_total; ++i)
906+ stack[i] = i;
907+ }
908+
900909 void release (void ) {
901910 if (raw_buffer)
902911 delete[] raw_buffer;
You can’t perform that action at this time.
0 commit comments