Skip to content

Commit 76b8056

Browse files
authored
[type layout] usize and isize have the same size and alignment
1 parent c49e89c commit 76b8056

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

src/type-layout.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ The size of most primitives is given in this table.
4444

4545
r[layout.primitive.size-int]
4646
`usize` and `isize` have a size big enough to contain every address on the target platform. For example, on a 32 bit target, this is 4 bytes, and on a 64 bit target, this is 8 bytes.
47+
`usize` and `isize` have the same size and alignment.
4748

4849
r[layout.primitive.align]
4950
The alignment of primitives is platform-specific. In most cases, their alignment is equal to their size, but it may be less. In particular, `i128` and `u128` are often aligned to 4 or 8 bytes even though their size is 16, and on many 32-bit platforms, `i64`, `u64`, and `f64` are only aligned to 4 bytes, not 8.

0 commit comments

Comments
 (0)