Re: [TECH TOPIC] Rust for Linux

James Bottomley
2021-07-07T07:52:27Z

On Wed, 2021-07-07 at 09:45 +0200, Greg KH wrote:
> On Wed, Jul 07, 2021 at 09:27:32AM +0200, Julia Lawall wrote:
[...]
> > Where should the free have been? Will Rust help in this
> > case? Will it result in a memory leak?
>
> This is going to be the "interesting" part of the rust work, where it
> has to figure out how to map the reference counted objects that we
> currently have in the driver model across to rust-controlled objects
> and keep everything in sync properly.

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.

James