Skip to content

Commit

Permalink
Document no_std support
Browse files Browse the repository at this point in the history
  • Loading branch information
mbrubeck committed Jun 20, 2017
1 parent 1b4cf36 commit 31dcc49
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ authors = ["Simon Sapin <[email protected]>"]
license = "MPL-2.0"
repository = "https://github.com/servo/rust-smallvec"
description = "'Small vector' optimization: store up to a small number of items on the stack"
keywords = ["small", "vec", "vector", "stack"]
keywords = ["small", "vec", "vector", "stack", "no_std"]
readme = "README.md"
documentation = "http://doc.servo.org/smallvec/"

Expand Down
9 changes: 9 additions & 0 deletions lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@
//! Small vectors in various sizes. These store a certain number of elements inline, and fall back
//! to the heap for larger allocations. This can be a useful optimization for improving cache
//! locality and reducing allocator traffic for workloads that fit within the inline buffer.
//!
//! ## no_std support
//!
//! By default, `smallvec` depends on `libstd`. However, it can be configured to use the unstable
//! `liballoc` API instead, for use on platforms that have `liballoc` but not `libstd`. This
//! configuration is currently unstable and is not guaranteed to work on all versions of Rust.
//!
//! To depend on `smallvec` without `libstd`, use `default-features = false` in the `smallvec`
//! section of Cargo.toml to disable its `"std"` feature.
#![cfg_attr(not(feature = "std"), no_std)]
#![cfg_attr(not(feature = "std"), feature(alloc))]
Expand Down

0 comments on commit 31dcc49

Please sign in to comment.