Rich-T-kid commented on code in PR #10220:
URL: https://github.com/apache/arrow-rs/pull/10220#discussion_r3486322466


##########
arrow-ipc/src/compression.rs:
##########
@@ -26,14 +27,25 @@ const LENGTH_OF_PREFIX_DATA: i64 = 8;
 ///
 /// In the case of zstd, this will contain the zstd context, which can be 
reused between subsequent
 /// compression calls to avoid the performance overhead of initialising a new 
context for every
-/// compression.
+/// compression. Also holds a [`FlatBufferBuilder`] that is reused across IPC 
writes.
 #[derive(Default)]
 pub struct CompressionContext {
+    fbb: FlatBufferBuilder<'static>,
     #[cfg(feature = "zstd")]
     compressor: Option<zstd::bulk::Compressor<'static>>,
 }
 
 impl CompressionContext {
+    /// Takes the stored fbb, leaving a zero-capacity placeholder. Must be 
returned via [`Self::return_fbb`].
+    pub(crate) fn take_fbb(&mut self) -> FlatBufferBuilder<'static> {

Review Comment:
   makes sense to me.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to