Rust Transitioning Kernel Code
safe code in kernel wc -l < alloc.rs 445 grep unsafe alloc.rs 39 grep unsafe alloc.rs pub unsafe fn alloc(layout: Layout) -> *mut u8 { pub unsafe fn __rust_alloc(layout: usize, align: usize) -> *mut u8 { pub unsafe fn __rust_dealloc(ptr: *mut u8, layout: usize, align: usize) { pub unsafe fn __rust_realloc(ptr: *mut u8, layout: usize, new_size: usize) -> *mut u8 { pub unsafe fn __rust_realloc(ptr: *mut u8, layout: usize, new_size: usize) -> *mut u8 { /// # Safety /// /// The caller must ensure that `ptr` is valid for reads and writes of `new_size` bytes. pub unsafe fn alloc_zeroed(layout: Layout) -> *mut u8 { let current = layout.size(); let size = unsafe { unsafe fn grow_inplace(layout: Layout) -> *mut u8 { old_size: if old_layout.align() == new_layout.align() => unsafe { old_size == unsafe { unsafe fn alloc_error(layout: Layout) { unsafe { dealloc(ptr.as_ptr(), layout); } unsafe fn grow_zeroed unsafe fn grow_in_place(ptr, old_layout, new_layout, false) { unsafe fn shrink(ptr, old_layout, new_layout, true) { unsafe fn dealloc() { >https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/rust/alloc/alloc.rs?h=v6.6.9 I'm convinced, linux kernel is now safe after merging rust support. i too will be transitioning my codebase. Delete this >Rust >transitioning Sounds about right
A forum screenshot shows a code listing full of unsafe Rust functions, followed by a post claiming that the Linux kernel is now safe after merging Rust support and that the author will transition their codebase. Replies mock the claim by pointing out that the poster should delete it, while another sarcastically says that transitioning to Rust sounds about right. The joke targets overconfident claims about Rust making kernel code safe despite the visible abundance of unsafe code. EN: A forum screenshot shows a code listing full of unsafe Rust functions, followed by a post claiming that the Linux kernel is now safe after merging Rust support and that the author will transition their codebase. Replies mock the claim by pointing out that the poster should delete it, while another sarcastically says that transitioning to Rust sounds about right. The joke targets overconfident claims about Rust making kernel code safe despite the visible abundance of unsafe code.
- @gentoomemes / 8484 2024-01-04
- Type
- image
- Size
- 433×800 · 74.5 KiB
- Mood
- sarcastic
- Language
- en
- Added