summary refs log tree commit diff
diff options
context:
space:
mode:
authoredef <edef@unfathomable.blue>2022-06-19 10:05:35 +0000
committeredef <edef@unfathomable.blue>2022-06-19 10:05:35 +0000
commit4f310d2b64e03a3f87f9e444ed777f57655726dc (patch)
treeeafdc7dea41a468ef4711554329adf902d40282c
parent4173cfc20899aea0b5e8f55fc348ca5df6c1629e (diff)
ripple/fossil: box the bao decoder
Shuffling 3k around on the stack doesn't make anyone happy.

Change-Id: I444fc22267380d9b99ca63ca148b9a9e85238b5a
-rw-r--r--ripple/fossil/src/lib.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/ripple/fossil/src/lib.rs b/ripple/fossil/src/lib.rs
index 85943f0..6420437 100644
--- a/ripple/fossil/src/lib.rs
+++ b/ripple/fossil/src/lib.rs
@@ -294,7 +294,8 @@ impl Store {
 			})
 			.collect();
 
-		Some(Blob(bao::decode::Decoder::new_outboard(
+		// the decoder is almost 3k in size, so boxing it seems preferable
+		Some(Blob(Box::new(bao::decode::Decoder::new_outboard(
 			RawBlob {
 				store: self,
 				chunks,
@@ -303,11 +304,11 @@ impl Store {
 			},
 			io::Cursor::new(bao_inline),
 			&ident,
-		)))
+		))))
 	}
 }
 
-pub struct Blob<'a>(bao::decode::Decoder<RawBlob<'a>, std::io::Cursor<Vec<u8>>>);
+pub struct Blob<'a>(Box<bao::decode::Decoder<RawBlob<'a>, std::io::Cursor<Vec<u8>>>>);
 
 impl io::Read for Blob<'_> {
 	fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> {