Skip to content
This repository has been archived by the owner on Oct 30, 2024. It is now read-only.

Commit

Permalink
Only retain two allocations (TimelyDataflow#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 and vmarcos committed Nov 23, 2023
1 parent d9896ce commit 209b6ec
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 @@ -200,7 +200,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 209b6ec

Please sign in to comment.