Skip to content

Commit 2ceb100

Browse files
committed
v0.3.1
1 parent bdaa2ac commit 2ceb100

File tree

3 files changed

+15
-6
lines changed

3 files changed

+15
-6
lines changed

CHANGELOG.md

+8-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
77

88
## [Unreleased]
99

10+
## [v0.3.1] - 2017-10-07
11+
12+
### Fixed
13+
14+
- The example in the documentation.
15+
1016
## [v0.3.0] - 2017-10-07
1117

1218
### Changed
@@ -39,7 +45,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
3945

4046
- Initial version of the allocator
4147

42-
[Unreleased]: https://github.com/japaric/alloc-cortex-m/compare/v0.3.0...HEAD
48+
[Unreleased]: https://github.com/japaric/alloc-cortex-m/compare/v0.3.1...HEAD
49+
[v0.3.1]: https://github.com/japaric/alloc-cortex-m/compare/v0.3.0...v0.3.1
4350
[v0.3.0]: https://github.com/japaric/alloc-cortex-m/compare/v0.2.2...v0.3.0
4451
[v0.2.2]: https://github.com/japaric/alloc-cortex-m/compare/v0.2.1...v0.2.2
4552
[v0.2.1]: https://github.com/japaric/alloc-cortex-m/compare/v0.2.0...v0.2.1

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ keywords = [
1212
]
1313
license = "MIT OR Apache-2.0"
1414
name = "alloc-cortex-m"
15-
version = "0.3.0"
15+
version = "0.3.1"
1616

1717
[dependencies]
1818
cortex-m = "0.1.5"

src/lib.rs

+6-4
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,16 @@
1515
//!
1616
//! // These symbols come from a linker script
1717
//! extern "C" {
18-
//! static mut _heap_start: usize;
19-
//! static mut _heap_end: usize;
18+
//! static mut _sheap: u32;
19+
//! static mut _eheap: u32;
2020
//! }
2121
//!
2222
//! #[no_mangle]
2323
//! pub fn main() -> ! {
2424
//! // Initialize the heap BEFORE you use the allocator
25-
//! unsafe { ALLOCATOR.init(_heap_start, _heap_end - _heap_start) }
25+
//! let start = unsafe { &mut _sheap as *mut u32 as usize };
26+
//! let end = unsafe { &mut _sheap as *mut u32 as usize };
27+
//! unsafe { ALLOCATOR.init(start, end - start) }
2628
//!
2729
//! let mut xs = Vec::new();
2830
//! xs.push(1);
@@ -108,4 +110,4 @@ unsafe impl<'a> Alloc for &'a CortexMHeap {
108110
unsafe fn dealloc(&mut self, ptr: *mut u8, layout: Layout) {
109111
self.heap.lock(|heap| heap.deallocate(ptr, layout));
110112
}
111-
}
113+
}

0 commit comments

Comments
 (0)