3 ms·
> Async Rust (by default) can allocate memory Strictly speaking, async rust never allocates. In fact, no language features do; allocation is a library concern
by steveklabnik 2y ago
> Async Rust (by default) can allocate memory
Strictly speaking, async rust never allocates. In fact, no language features do; allocation is a library concern in Rust.
What does allocate memory are the executors created for non-embedded environments. But just like any user-written code, you can use different implementations that do something else instead. Like you’d imagine, ones for embedded environments would use some statically allocated memory that’s bounded in size. Heck, you can go so far as to just leave them on the stack, like lilos: https://github.com/cbiffle/lilos/blob/main/doc/intro.adoc#using-static-for-state https://github.com/cbiffle/lilos/blob/main/doc/intro.adoc#us...
Not trying to say this means that you’re incorrect about any of the other things you’re talking about; I haven’t worked on realtime systems so I can’t speak on them.