File tree 1 file changed +11
-0
lines changed
1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change 14
14
//!
15
15
//! To depend on `smallvec` without `libstd`, use `default-features = false` in the `smallvec`
16
16
//! section of Cargo.toml to disable its `"std"` feature.
17
+ //!
18
+ //! ## `union` feature
19
+ //!
20
+ //! When the `union` feature is enabled `smallvec` will track its state (inline or spilled)
21
+ //! without the use of an enum tag, reducing the size of the `smallvec` by one machine word.
22
+ //! This means that there is potentially no space overhead compared to `Vec`.
23
+ //! Note that `smallvec` can still be larger than `Vec` if the inline buffer is larger than two
24
+ //! machine words.
25
+ //!
26
+ //! To use this feature add `features = ["union"]` in the `smallvec` section of Cargo.toml.
27
+ //! Note that this feature requires a nightly compiler (for now).
17
28
18
29
#![ cfg_attr( not( feature = "std" ) , no_std) ]
19
30
#![ cfg_attr( not( feature = "std" ) , feature( alloc) ) ]
You can’t perform that action at this time.
0 commit comments