diff --git a/riscv-rt/CHANGELOG.md b/riscv-rt/CHANGELOG.md index bb82c85d..4986a1f9 100644 --- a/riscv-rt/CHANGELOG.md +++ b/riscv-rt/CHANGELOG.md @@ -21,6 +21,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ### Fixed +- Fix undefined behavior in heap initialization example documentation - Fix stack allocation algorithm for multi-core targets without M extension ## [v0.16.0] - 2025-09-08 diff --git a/riscv-rt/src/lib.rs b/riscv-rt/src/lib.rs index 8760495e..1faf4284 100644 --- a/riscv-rt/src/lib.rs +++ b/riscv-rt/src/lib.rs @@ -279,7 +279,7 @@ //! fn main() { //! unsafe { //! let heap_bottom = riscv_rt::heap_start() as usize; -//! let heap_size = &_heap_size as *const u8 as usize; +//! let heap_size = core::ptr::addr_of!(_heap_size) as usize; //! some_allocator::initialize(heap_bottom, heap_size); //! } //! }