-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Section 15.6 title is maybe a little misleading #575
Comments
What about "Creating Reference Cycles Can Leak Memory"? |
That seems reasonable. I feel like there should still be some mention of memory safety involved, since that's one of Rust's big concerns, but maybe I'm trying to pack too much information into a section heading... |
I do like the pithy saying "memory leaks are memory safe", but I think I worked that into the text, which is probably a better place, as you're saying. Would you like to send in a PR or would you like me to take care of this? Either is fine with me! ❤️ |
You know what... Nowadays more and more people are accepting to use the term "memory leak" to mean carelessly making objects' lifetime too long. As @carols10cents How about "Reference Cycles Can Leak Memory" ? |
The title for section 15.6 is "Creating Reference Cycles and Leaking Memory is Safe". At a glance this could imply that Rust magically cleans up after you somehow, which might be deceptive to new people (even though you explain exactly what you mean in the first paragraph after that title). An alternative might be to just say "Creating Reference Cycles and Leaking Memory is Not Unsafe".
It might also be worth saying that, while Rust doesn't guarantee lack of memory leaks, under most circumstances the only way it will happen is if you create cycles through refcounted pointer types. Just saying "preventing memory leaks is not one of Rust's guarantees" leaves open the possibility that safe code which does not create refcount cycles still could leak memory, which as far as I know should never happen.
The text was updated successfully, but these errors were encountered: