I have a program that I want to be able to run with no_std.
It uses some vectors and/or boxes (which won't fit on the stack), and it's already written that all allocations occur at the start, and their size is known at compile time and fixed during runtime, I don't push to vectors or anything.
That is, I have something like this:
impl<A,B,C> MainStruct<A,B,C> {
fn new() -> Self {...}
fn size() -> usize
}
and all allocations are done within new (which may instantiate other structs which are organised in the same way).
What is the cleanest, idiomatic way to implement this with no_std? Do I implement my own allocator, with fixed size determined by MainStruct::<A,B,C>::size()
? Does a suitable crate already exist? Or can anyone point to something I could base it off of?
It seems bumpalo is sort of suited for this, except my requirements are even simpler: no dynamic allocation and no growing collections.