Skip to content
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

RefCell needs more explanation: heap or stack? #1963

Open
liufeimath opened this issue May 20, 2019 · 0 comments
Open

RefCell needs more explanation: heap or stack? #1963

liufeimath opened this issue May 20, 2019 · 0 comments
Milestone

Comments

@liufeimath
Copy link

The RefCell chapter gives the reader an impression that RefCell is no different from Box other than the additional support of runtime mutability check. However there's another big difference: Box manages object on the heap while RefCell is just a stack variable wrapper. I think this needs to be clearly stated when introducing RefCell to the reader, otherwise it can cause confusions (see this discussion in the forum).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants