Thread (192 messages) 192 messages, 41 authors, 2022-10-16

Re: [PATCH 00/13] [RFC] Rust support

From: Miguel Ojeda <hidden>
Date: 2021-04-16 14:21:17
Also in: linux-doc, linux-kbuild, lkml

On Fri, Apr 16, 2021 at 1:24 PM Peter Zijlstra [off-list ref] wrote:
IMO RAII is over-valued, but just in case you care, the below seems to
work just fine. No fancy new language needed, works today. Similarly you
can create refcount_t guards, or with a little more work full blown
smart_ptr crud.
Please note that even smart pointers (as in C++'s `std::unique_ptr`
etc.) do not guarantee memory safety. Yes, they help a lot writing
sound code (in particular exception-safe C++ code), but they do not
bring the same guarantees.

That's why using C language extensions (the existing ones, that is) to
recreate RAII/guards, smart pointers, etc. would only bring you to a
point closer to C++, but not to Rust.

Cheers,
Miguel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help