diff --git a/src/map/include/computeMap.hpp b/src/map/include/computeMap.hpp index c48427dd..da948ebe 100644 --- a/src/map/include/computeMap.hpp +++ b/src/map/include/computeMap.hpp @@ -140,12 +140,15 @@ namespace skch typedef atomic_queue::AtomicQueue input_atomic_queue_t; typedef atomic_queue::AtomicQueue output_atomic_queue_t; - void processFragment(FragmentData* fragment) { - std::vector intervalPoints; - std::vector l1Mappings; - MappingResultsVector_t l2Mappings; + void processFragment(FragmentData* fragment, + std::vector& intervalPoints, + std::vector& l1Mappings, + MappingResultsVector_t& l2Mappings, + QueryMetaData& Q) { + intervalPoints.clear(); + l1Mappings.clear(); + l2Mappings.clear(); - QueryMetaData Q; Q.seq = const_cast(fragment->seq); Q.len = fragment->len; Q.fullLen = fragment->fullLen; @@ -829,11 +832,16 @@ namespace skch void fragment_thread(fragment_atomic_queue_t& fragment_queue, std::atomic& fragments_done) { + std::vector intervalPoints; + std::vector l1Mappings; + MappingResultsVector_t l2Mappings; + QueryMetaData Q; + while (!fragments_done.load()) { FragmentData* fragment = nullptr; if (fragment_queue.try_pop(fragment)) { if (fragment) { - processFragment(fragment); + processFragment(fragment, intervalPoints, l1Mappings, l2Mappings, Q); } } else { std::this_thread::sleep_for(std::chrono::milliseconds(10));