Skip to content
This repository
Browse code

fixup! Resize merge heap when no longer needed

  • Loading branch information...
commit fa1e12e84a05b46844e8a1d599c12201dea6817d 1 parent e916966
Mathias Rav Mortal authored

Showing 1 changed file with 2 additions and 1 deletion. Show diff stats Hide diff stats

  1. +2 1  tpie/priority_queue.inl
3  tpie/priority_queue.inl
@@ -525,6 +525,7 @@ void priority_queue<T, Comparator, OPQType>::fill_buffer() {
525 525 << get_memory_manager().available() << "b" << std::endl;
526 526 #endif
527 527
  528 + {
528 529 pq_merge_heap<T, Comparator> heap(current_r);
529 530
530 531 tpie::array<tpie::auto_ptr<file_stream<T> > > data(current_r);
@@ -562,7 +563,7 @@ void priority_queue<T, Comparator, OPQType>::fill_buffer() {
562 563 }
563 564 }
564 565 }
565   - heap.resize(0);
  566 + } // destruct and deallocate `heap'
566 567 #ifndef TPIE_NDEBUG
567 568 std::cout << "memavail before mb alloc: "
568 569 << get_memory_manager().available() << "b" << std::endl;

0 comments on commit fa1e12e

Please sign in to comment.
Something went wrong with that request. Please try again.