From ef077ed7dec5ecf1eb15907367e7036e7810f834 Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Thu, 20 Apr 2023 13:06:33 +0800 Subject: [PATCH] codec: place codec object into heap The codec object contains a lot of data including a `FrameRing` buffer as well as some other services. With the latest version of Rust, this has grown large and no longer fits onto the stack. As a result, it crashes with a stack overflow immediately upon boot. Move the Codec onto the heap. This frees up stack and allows it to run under Rust 1.69.0. Signed-off-by: Sean Cross --- services/codec/src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/codec/src/main.rs b/services/codec/src/main.rs index 545e845ac..818ab3be8 100644 --- a/services/codec/src/main.rs +++ b/services/codec/src/main.rs @@ -31,7 +31,7 @@ fn main() -> ! { log::trace!("registered with NS -- {:?}", codec_sid); let codec_conn = xous::connect(codec_sid).expect("couldn't make connection for the codec implementation"); - let mut codec = Codec::new(codec_conn, &xns); + let mut codec = Box::new(Codec::new(codec_conn, &xns)); let ticktimer = ticktimer_server::Ticktimer::new().unwrap(); log::trace!("ready to accept requests");