Re: [TECH TOPIC] Rust for Linux

Miguel Ojeda
2021-07-07T13:49:24Z

On Wed, Jul 7, 2021 at 9:52 AM James Bottomley
<James.Bottomley@hansenpartnership.com> wrote:
>
> Rust has a reference counted pointer: Rc<T>. However the problem is
> the rust memory model is via strict accounting, so once you start using
> refcounts, which need shared accounting, you can then get memory leaks
> and it's unclear if rust actually buys you anything over C for this use
> case.

Even if you are using `Rc<T>`, Rust buys you a *lot*. For starters, it
still prevents UB and data races -- e.g. it prevents mistakenly
sharing the `Rc` with other threads.

Cheers,
Miguel