Skip to content

Commit 666b2ca

Browse files
committed
The Safe Pinned Initialization Problem: add banner warning about outdated content
Suggested-by: Onur Özkan <work@onurozkan.dev> Link: https://rust-for-linux.zulipchat.com/#narrow/channel/561532-pin-init/topic/outdated.20information.20on.20docs/near/598689465 Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
1 parent 82222a3 commit 666b2ca

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

src/The-Safe-Pinned-Initialization-Problem.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# The Safe Pinned Initialization Problem
22

3+
> **Note:** This document is a historical article from 2022/2023. It contains outdated information.
4+
35
## Introduction to Pinning
46

57
In the kernel many data structures are not allowed to change address, since there exist external pointers to them that would then be invalidated. Since this could cause memory errors, Rust has to *somehow* guarantee that this cannot happen in safe code. Luckily there already exists the [`Pin<P>`] wrapper type for arbitrary pointer types `P`. For simplicity we will look at `P = Box<T>`. [`Box<T>`] is a smart pointer that owns a `T` (a generic parameter) allocated on the heap. When a [`Box<T>`] is dropped (destroyed) then it automatically frees the memory.

0 commit comments

Comments
 (0)