#Looking for feedback on a diagram I made about memory management in Rust
7 messages · Page 1 of 1 (latest)
My main issues with this are:
- Most of this stuff depends on the linker (script), so details may vary
- I think string literals may end up in the text section? or ro_data if you have that.
- Technically saying "locals" are on the stack isn't really true. Especially in such a small program, they will likely all be in registers.
Whether you consider these incorrect or not, is up to you
Oh, also "heap may be significantly slower than the stack" is a somewhat inaccurate statement. The heap allocations are usually the slow part, after that it's up to cache locality.
I'm also pretty sure there was a very similar diagram on this server a while back, but this stuff is hard to find
I would also just preface it with this is what virtual memory looks like for that program