Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

No. I'm interested in a dynamically allocated vector, where you take a pointer/reference/access to one of the elements and then try to add some more, which may cause the vector to reallocate and move in memory. Naively, this will leave the access dangling, pointing at invalid memory (which is not safe).

The three solutions I mentioned: GC protects against this by not deallocating the original array. Disallowing taking references makes the whole situation impossible. Rust protects against it by disallowing mutation of the vector while the reference exists.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: