From 16c8d1f44d94001e5fc5aa7f2e4450bc5a8db728 Mon Sep 17 00:00:00 2001 From: Jonathan 'theJPster' Pallant Date: Fri, 9 Nov 2018 21:36:00 +0000 Subject: [PATCH] Update comments on heap availability on no_std. As per https://github.com/rust-embedded/book/issues/33. --- src/intro/no-std.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/intro/no-std.md b/src/intro/no-std.md index bcbcf01..d72f593 100644 --- a/src/intro/no-std.md +++ b/src/intro/no-std.md @@ -44,13 +44,20 @@ bootstrapping (stage 0) code like bootloaders, firmware or kernels. | feature | no\_std | std | |-----------------------------------------------------------|--------|-----| -| heap (dynamic memory) | ✘ | ✓ | +| heap (dynamic memory) | * | ✓ | +| collections (Vec, HashMap, etc) | ** | ✓ | | stack overflow protection | ✘ | ✓ | | runs init code before main | ✘ | ✓ | | libstd available | ✘ | ✓ | | libcore available | ✓ | ✓ | | writing firmware, kernel, or bootloader code | ✓ | ✘ | +\* Only if you use the `alloc` crate and use a suitable allocator like [alloc-cortex-m]. + +\** Only if you use the `collections` crate and configure a global default allocator. + +[alloc-cortex-m]: https://github.com/rust-embedded/alloc-cortex-m + ## See Also * [FAQ](https://www.rust-lang.org/en-US/faq.html#does-rust-work-without-the-standard-library) * [RFC-1184](https://github.com/rust-lang/rfcs/blob/master/text/1184-stabilize-no_std.md)