Skip to content

Commit d0b0900

Browse files
authored
Merge pull request #2273 from ehuss/cfg_target_has_atomic_primitive_alignment
Document `target_has_atomic_primitive_alignment`
2 parents 5978835 + f1b7b9a commit d0b0900

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

src/conditional-compilation.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,25 @@ Possible values:
256256
* `"128"`
257257
* `"ptr"`
258258

259+
r[cfg.target_has_atomic_primitive_alignment]
260+
### `target_has_atomic_primitive_alignment`
261+
262+
r[cfg.target_has_atomic_primitive_alignment.def]
263+
Key-value option set for each bit width where the [atomic][core::sync::atomic] type has the same alignment as the corresponding integer type.
264+
265+
> [!NOTE]
266+
> The alignment is usually the same for a given bit width. However, on some targets such as 32-bit x86, 64-bit atomic types such as [`AtomicI64`][core::sync::atomic::AtomicI64] have an alignment of 8 bytes while `i64` is only aligned to 4 bytes. In this situation, `target_has_atomic_primitive_alignment = "64"` is not set.
267+
268+
r[cfg.target_has_atomic_primitive_alignment.values]
269+
Possible values:
270+
271+
* `"8"`
272+
* `"16"`
273+
* `"32"`
274+
* `"64"`
275+
* `"128"`
276+
* `"ptr"`
277+
259278
r[cfg.test]
260279
### `test`
261280

0 commit comments

Comments
 (0)