Skip to content

Commit

Permalink
Only retain two allocations (#425)
Browse files Browse the repository at this point in the history
This fixes retaining memory as large as the output when sealing the merge
batcher for columnation.

Signed-off-by: Moritz Hoffmann <antiguru@gmail.com>
  • Loading branch information
antiguru authored Nov 23, 2023
1 parent 65f39ab commit 97bda37
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/trace/implementations/merge_batcher_col.rs
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ impl<D: Ord+Clone+Columnation+'static, T: Ord+Clone+Columnation+'static, R: Semi

/// Insert an empty buffer into the stash. Panics if the buffer is not empty.
fn recycle(&mut self, mut buffer: TimelyStack<(D, T, R)>) {
if buffer.capacity() == Self::buffer_size() {
if buffer.capacity() == Self::buffer_size() && self.stash.len() <= 2 {
buffer.clear();
self.stash.push(buffer);
}
Expand Down

0 comments on commit 97bda37

Please sign in to comment.