4 ms·
for me this is the big point. stack-based memory allocation works great as long as your usage and sharing follows the control flow. but when it doesn't, rust re
by convolvatron 4y ago
for me this is the big point. stack-based memory allocation works great as long as your usage and sharing follows the control flow. but when it doesn't, rust really leaves you in a bad spot and you get to play with:
- Arcing everything
- using a fixed-sized ancillary array and passing indices
- creating threads that correspond to the lifetimes you care about
- fighting your way through adding explicit lifetime allocations and
- delaying reclamation of _everything_ above it on the stack
...
and while workable, none of those things are particularly nice
- insanitybit 4y agoIDK, it's pretty easy to just Arc something if it has to be shared across threads. That's what you do in other languages. It's rare that I care to deal with the thread lifetimes themselves.