Yeah, those would both be correct, but disappointing solutions.
Nobody has come up with anything better yet that I'm aware of unfortunately, other than "don't use malloc and only have a custom pool/slab allocator instead of `alloc`/malloc", which isn't too offensive as emb rust is light on alloc.