Thanks to visit codestin.com
Credit goes to github.com

Skip to content

RefCell needs more explanation: heap or stack? #1963

@liufeimath

Description

@liufeimath

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).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions