Skip to content

Commit e167a73

Browse files
committed
Describe the align feature in the readme
1 parent 2819634 commit e167a73

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,16 @@ this via:
3535
libc = { version = "0.2", default-features = false }
3636
```
3737

38+
By default libc uses private fields in structs in order to enforce a certain
39+
memory alignment on them. These structs can be hard to instantiate outside of
40+
libc. To make libc use `#[repr(align(x))]`, instead of the private fields,
41+
activate the *align* feature. This requires Rust 1.25 or newer:
42+
43+
```toml
44+
[dependencies]
45+
libc = { version = "0.2", features = ["align"] }
46+
```
47+
3848
## What is libc?
3949

4050
The primary purpose of this crate is to provide all of the definitions necessary

0 commit comments

Comments
 (0)