From 9ae50092ab58eb9edf2bfb0eb010c9333281b093 Mon Sep 17 00:00:00 2001 From: Moritz Hoffmann Date: Tue, 7 May 2024 10:50:29 -0400 Subject: [PATCH] Seal: Drop chain while feeding data to builder 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 --- src/trace/implementations/merge_batcher_col.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/trace/implementations/merge_batcher_col.rs b/src/trace/implementations/merge_batcher_col.rs index 72ec79efa..aed0039d8 100644 --- a/src/trace/implementations/merge_batcher_col.rs +++ b/src/trace/implementations/merge_batcher_col.rs @@ -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())