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 <sean@xobs.io>
This commit is contained in:
Sean Cross 2023-04-20 13:06:33 +08:00
parent 97da54437e
commit ef077ed7de

View file

@ -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");