Just for fun and knowledge I am going completely barebones Rust for my arm MCU. No std, no other crates.
I am trying to hack up the equivalent of the
vec struct so I can create arrays at runtime. The idea is that
myVec will be unsafe, but all the rest of the code safe.
My problem is that it doesn't seem like it's possible to get the size of a generic parameter, so not sure how to find how much memory to allocate.
Any idea how vec actually overcomes that? I tried to have a look at the
vec code but I got confused.