Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit263861f

Browse files
committed
Update safety docs for AtomicBool::from_ptr.
Clarify that alignment is never an issue, since `align_of::<AtomicBool>() == 1`.
1 parentcf9de23 commit263861f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

‎core/src/sync/atomic.rs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -443,8 +443,8 @@ impl AtomicBool {
443443
///
444444
/// # Safety
445445
///
446-
/// * `ptr` must be aligned to `align_of::<AtomicBool>()` (note thaton some platforms this can
447-
///be bigger than`align_of::<bool>()`).
446+
/// * `ptr` must be aligned to `align_of::<AtomicBool>()` (note thatthis is always true, since
447+
/// `align_of::<AtomicBool>() == 1`).
448448
/// * `ptr` must be [valid] for both reads and writes for the whole lifetime `'a`.
449449
/// * You must adhere to the [Memory model for atomic accesses]. In particular, it is not
450450
/// allowed to mix atomic and non-atomic accesses, or atomic accesses of different sizes,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp