Skip to content

Commit

Permalink
Seal: Drop chain while feeding data to builder (#482)
Browse files Browse the repository at this point in the history
Fix a regression where the columnated merge batcher would only
deallocate the merged chain after revealing all data to the builder.
Instead, it now drains the chain, which deallocates each chunk after
revealing its contents to the builder.

Signed-off-by: Moritz Hoffmann <[email protected]>
  • Loading branch information
antiguru authored May 7, 2024
1 parent de6a353 commit abe18c5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/trace/implementations/merge_batcher_col.rs
Original file line number Diff line number Diff line change
Expand Up @@ -291,8 +291,10 @@ where
}
let mut builder = B::with_capacity(keys, vals, upds);

for datum in chain.iter().flat_map(|ts| ts.iter()) {
builder.copy(datum);
for chunk in chain.drain(..) {
for datum in chunk.iter() {
builder.copy(datum);
}
}

builder.done(lower.to_owned(), upper.to_owned(), since.to_owned())
Expand Down

0 comments on commit abe18c5

Please sign in to comment.