Permalink
Browse files

fixup! Resize merge heap when no longer needed

  • Loading branch information...
1 parent e916966 commit fa1e12e84a05b46844e8a1d599c12201dea6817d @Mortal Mortal committed Oct 26, 2012
Showing with 2 additions and 1 deletion.
  1. +2 −1 tpie/priority_queue.inl
View
3 tpie/priority_queue.inl
@@ -525,6 +525,7 @@ void priority_queue<T, Comparator, OPQType>::fill_buffer() {
<< get_memory_manager().available() << "b" << std::endl;
#endif
+ {
pq_merge_heap<T, Comparator> heap(current_r);
tpie::array<tpie::auto_ptr<file_stream<T> > > data(current_r);
@@ -562,7 +563,7 @@ void priority_queue<T, Comparator, OPQType>::fill_buffer() {
}
}
}
- heap.resize(0);
+ } // destruct and deallocate `heap'
#ifndef TPIE_NDEBUG
std::cout << "memavail before mb alloc: "
<< get_memory_manager().available() << "b" << std::endl;

0 comments on commit fa1e12e

Please sign in to comment.