News for hackers. Stuff that matters.
Re:Rust Memory Management by falcolas on Tuesday May 09, 2017 @10:25AM (#14300242)
Sure, it's the default, but C and C++ encourage have patterns where calls to `malloc` and `new` much more common than in Rust. Especially since strings are almost always handled as malloc'ed buffers.

I'm just wondering if the extra emphasis on stack allocation has created issues; this article doesn't cover the allocation of Strings or Vecs (wrapping them in RC and ARC boxes), and most other references on the net are a few years old now.

Re:Rust Memory Management by masklinn on Tuesday May 09, 2017 @10:46AM (#14300445)
> I'm just wondering if the extra emphasis on stack allocation has created issues; this article doesn't cover the allocation of Strings or Vecs

As in C++, these are small stack structures (a few words, IIRC it's 3 for Vec, and String is backed by a Vec) pointing to a heap-allocated buffer.

Re:Rust Memory Management by steveklabnik on Tuesday May 09, 2017 @10:51AM (#14300488)
The second edition of the book goes into it in great detail https://doc.rust-lang.org/nightly/book/second-edition/ch04-0...