Commit 2fcea9f
authored
Rollup merge of rust-lang#143859 - orlp:thread-into-raw-align, r=jhpratt
Guarantee 8 bytes of alignment in Thread::into_raw
When using `AtomicPtr` for synchronization it's incredibly useful when you've got a couple bits you can stuff metadata in. By guaranteeing that `Thread`'s `Inner` struct is aligned to 8 bytes everyone can use the bottom 3 bits to signal other things, such as a critical section, etc.
This guarantee is thus very useful and costs us nothing.1 file changed
+7
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1399 | 1399 | | |
1400 | 1400 | | |
1401 | 1401 | | |
| 1402 | + | |
| 1403 | + | |
| 1404 | + | |
| 1405 | + | |
| 1406 | + | |
1402 | 1407 | | |
1403 | 1408 | | |
1404 | 1409 | | |
| |||
1582 | 1587 | | |
1583 | 1588 | | |
1584 | 1589 | | |
1585 | | - | |
| 1590 | + | |
| 1591 | + | |
1586 | 1592 | | |
1587 | 1593 | | |
1588 | 1594 | | |
| |||
0 commit comments