You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: src/lib.rs
+12-2
Original file line number
Diff line number
Diff line change
@@ -86,14 +86,24 @@ fn main() {
86
86
87
87
# Implementation details
88
88
89
-
The `Deref` implementation uses a hidden static variable that is guarded by a atomic check on each access. On stable Rust, the macro may need to allocate each static on the heap.
89
+
The `Deref` implementation uses a hidden static variable that is guarded by a atomic check on each access.
90
+
91
+
# Cargo features
92
+
93
+
This crate provides two cargo features:
94
+
95
+
- `nightly`: This uses unstable language features only available on the nightly release channel for a more optimal implementation. In practice this currently means avoiding a heap allocation per static. This feature might get deprecated at a later point once all relevant optimizations are usable from stable.
96
+
- `spin_no_std` (implies `nightly`): This allows using this crate in a no-std environment, by depending on the standalone `spin` crate.
97
+
98
+
Both features depend on unstable language features, which means
99
+
no guarantees can be made about them in regard to SemVer stability.
0 commit comments