Skip to content

Commit

Permalink
Only retain two allocations
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 committed Nov 23, 2023
1 parent 65f39ab commit 4d7c3d0
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 4d7c3d0

Please sign in to comment.