Skip to content

Commit f747b48

Browse files
committed
Document no_std support
1 parent ae5b615 commit f747b48

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ authors = ["Simon Sapin <[email protected]>"]
55
license = "MPL-2.0"
66
repository = "https://github.com/servo/rust-smallvec"
77
description = "'Small vector' optimization: store up to a small number of items on the stack"
8-
keywords = ["small", "vec", "vector", "stack"]
8+
keywords = ["small", "vec", "vector", "stack", "no_std"]
99
readme = "README.md"
1010
documentation = "http://doc.servo.org/smallvec/"
1111

lib.rs

+9
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,15 @@
55
//! Small vectors in various sizes. These store a certain number of elements inline, and fall back
66
//! to the heap for larger allocations. This can be a useful optimization for improving cache
77
//! locality and reducing allocator traffic for workloads that fit within the inline buffer.
8+
//!
9+
//! ## no_std support
10+
//!
11+
//! By default, `smallvec` depends on `libstd`. However, it can be configured to use the unstable
12+
//! `liballoc` API instead, for use on platforms that have `liballoc` but not `libstd`. This
13+
//! configuration is currently unstable and is not guaranteed to work on all versions of Rust.
14+
//!
15+
//! To depend on `smallvec` without `libstd`, use `default-features = false` in the `smallvec`
16+
//! section of Cargo.toml to disable its `"std"` feature.
817
918
#![cfg_attr(not(feature = "std"), no_std)]
1019
#![cfg_attr(not(feature = "std"), feature(alloc))]

0 commit comments

Comments
 (0)