Skip to content

Commit 4eaca3c

Browse files
authored
Merge pull request #700 from lzutao/fix-layout-table
group signed and unsigned integers in layout table
2 parents 1a0d0d5 + 82fc9fe commit 4eaca3c

File tree

1 file changed

+11
-16
lines changed

1 file changed

+11
-16
lines changed

src/type-layout.md

+11-16
Original file line numberDiff line numberDiff line change
@@ -34,22 +34,17 @@ alignment of the type respectively.
3434

3535
The size of most primitives is given in this table.
3636

37-
|Type | `size_of::<Type>()`|
38-
|-- |-- |
39-
|bool | 1 |
40-
|u8 | 1 |
41-
|u16 | 2 |
42-
|u32 | 4 |
43-
|u64 | 8 |
44-
|u128 | 16 |
45-
|i8 | 1 |
46-
|i16 | 2 |
47-
|i32 | 4 |
48-
|i64 | 8 |
49-
|i128 | 16 |
50-
|f32 | 4 |
51-
|f64 | 8 |
52-
|char | 4 |
37+
| Type | `size_of::<Type>()`|
38+
|-- |-- |
39+
| `bool` | 1 |
40+
| `u8` / `i8` | 1 |
41+
| `u16` / `i16` | 2 |
42+
| `u32` / `i32` | 4 |
43+
| `u64` / `i64` | 8 |
44+
| `u128` / `i128` | 16 |
45+
| `f32` | 4 |
46+
| `f64` | 8 |
47+
| `char` | 4 |
5348

5449
`usize` and `isize` have a size big enough to contain every address on the
5550
target platform. For example, on a 32 bit target, this is 4 bytes and on a 64

0 commit comments

Comments
 (0)