3 ms·
I thought we were talking about a situation with no heap! If you have that luxury, heck yeah just call malloc.
by steveklabnik 4y ago
I thought we were talking about a situation with no heap! If you have that luxury, heck yeah just call malloc.
- SAI_Peregrinus 4y agoThat's not always viable. Allowing heap allocation only at init is pretty common in embedded. Read config to get sizes, allocate at startup, never call free().
- steveklabnik 4y agoI don't understand what you mean by "That's not always viable." You can either call malloc, or you can't. If you can only call it at startup, only call it at startup. Every project has different requirements, and Rust will let you satisfy any of them.