From 01f16f17164e9ec579351956bdc96e4120baa765 Mon Sep 17 00:00:00 2001 From: Emil Fresk Date: Thu, 1 Jul 2021 10:01:53 +0200 Subject: [PATCH] Deprecate `Box::freeze`, prepare v0.7.3 --- CHANGELOG.md | 9 ++++++++- Cargo.toml | 2 +- src/pool/singleton.rs | 6 +++++- src/spsc.rs | 2 +- 4 files changed, 15 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e15aeb8454..ab05dbd727 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## [Unreleased] +## [v0.7.3] - 2021-07-1 + +### Changed + +- `Box::freeze` is deprecated due to possibility of undefined behavior. + ## [v0.7.2] - 2021-06-30 ### Added @@ -365,7 +371,8 @@ architecture. - Initial release -[Unreleased]: https://github.com/japaric/heapless/compare/v0.7.2...HEAD +[Unreleased]: https://github.com/japaric/heapless/compare/v0.7.3...HEAD +[v0.7.3]: https://github.com/japaric/heapless/compare/v0.7.2...v0.7.3 [v0.7.2]: https://github.com/japaric/heapless/compare/v0.7.1...v0.7.2 [v0.7.1]: https://github.com/japaric/heapless/compare/v0.7.0...v0.7.1 [v0.7.0]: https://github.com/japaric/heapless/compare/v0.6.1...v0.7.0 diff --git a/Cargo.toml b/Cargo.toml index 9f470c88e2..13410993e1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,7 +12,7 @@ keywords = ["static", "no-heap"] license = "MIT OR Apache-2.0" name = "heapless" repository = "https://github.com/japaric/heapless" -version = "0.7.2" +version = "0.7.3" [features] default = ["cas"] diff --git a/src/pool/singleton.rs b/src/pool/singleton.rs index 62de8c8f20..f7b6237820 100644 --- a/src/pool/singleton.rs +++ b/src/pool/singleton.rs @@ -123,7 +123,11 @@ where P: Pool, P::Data: AsRef<[u8]>, { - /// Freezes the contents of this memory block + #[deprecated( + since = "0.7.3", + note = "This can access uninitialized memory, use `init(..)` instead (https://github.com/japaric/heapless/issues/212)" + )] + /// (DO NOT USE, SEE DEPRECATION) Freezes the contents of this memory block /// /// See [rust-lang/rust#58363](https://github.com/rust-lang/rust/pull/58363) for details. pub fn freeze(self) -> Box { diff --git a/src/spsc.rs b/src/spsc.rs index b473bf7cb1..c4cd5ab825 100644 --- a/src/spsc.rs +++ b/src/spsc.rs @@ -1,6 +1,6 @@ //! Fixed capacity Single Producer Single Consumer (SPSC) queue //! -//! Implementation based on https://www.codeproject.com/Articles/43510/Lock-Free-Single-Producer-Single-Consumer-Circular +//! Implementation based on //! //! NOTE: This module is not available on targets that do *not* support atomic loads, e.g. RISC-V //! cores w/o the A (Atomic) extension