Skip to content

Commit 815fce4

Browse files
committed
minor tweaks, safety note
1 parent 82f7f5d commit 815fce4

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

examples/track_usage.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,12 @@ fn main() -> ! {
3838

3939
drop(alloc_vecs);
4040

41-
defmt::warn!(
41+
defmt::info!(
4242
"{} of {} heap memory are allocated after drop",
4343
HEAP_SIZE - HEAP.free(),
4444
HEAP_SIZE
4545
);
4646

47-
// Panic is expected here.
4847
semihosting::process::exit(0);
4948
}
5049

src/tlsf.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,8 @@ impl Heap {
115115
if !inner_mut.initialized {
116116
return 0;
117117
}
118+
// Safety: We pass the memory block we previously initialized the heap with
119+
// to the `iter_blocks` method.
118120
unsafe {
119121
inner_mut
120122
.tlsf

0 commit comments

Comments
 (0)