File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -1380,6 +1380,11 @@ where
13801380}
13811381
13821382/// The internal representation of a `Thread` handle
1383+ ///
1384+ /// We explicitly set the alignment for our guarantee in Thread::into_raw. This
1385+ /// allows applications to stuff extra metadata bits into the alignment, which
1386+ /// can be rather useful when working with atomics.
1387+ #[ repr( align( 8 ) ) ]
13831388struct Inner {
13841389 name : Option < ThreadNameString > ,
13851390 id : ThreadId ,
@@ -1563,7 +1568,8 @@ impl Thread {
15631568 /// Consumes the `Thread`, returning a raw pointer.
15641569 ///
15651570 /// To avoid a memory leak the pointer must be converted
1566- /// back into a `Thread` using [`Thread::from_raw`].
1571+ /// back into a `Thread` using [`Thread::from_raw`]. The pointer is
1572+ /// guaranteed to be aligned to at least 8 bytes.
15671573 ///
15681574 /// # Examples
15691575 ///
You can’t perform that action at this time.
0 commit comments