about summary refs log tree commit diff
path: root/src/rustllvm/RustWrapper.cpp
diff options
context:
space:
mode:
authorJohn Kleint <jk@hinge.co>2014-10-21 23:30:09 -0400
committerJohn Kleint <jk@hinge.co>2014-10-26 23:41:51 -0400
commitd257b376084ce18ae351e1f89989e36433515d24 (patch)
treeb3ba06d972b39e1c32ed39f7e3b35cb1f5c28a26 /src/rustllvm/RustWrapper.cpp
parentf037452447f5f46deb26e1c483fe88fb51a19198 (diff)
downloadrust-d257b376084ce18ae351e1f89989e36433515d24.tar.gz
rust-d257b376084ce18ae351e1f89989e36433515d24.zip
Guide: motivate Box and Rc pointers with need, uses, benefits, and examples.
Explain that Rust has different pointer types because there is a
tradeoff between flexibility and efficiency. Motivate boxes as
fixed-size containers of variable-sized objects. Clarify that Box and Rc
are pointer types that you deref with * just like references. Stick to
explaining the semantics and avoid implementation details.  Scope isn't
the most accurate framework to think about deallocation (since you
return boxes and otherwise move values out of scopes); it's more "when
the value is done being used," i.e., lifetime. Provide a connection
between Rust's pointer types by locating them on a flexibiltiy /
performance scale. Explain the compiler can't statically analyze
lifetimes with multiple owners; hence the need for (runtime) reference
counting.
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions