diff --git a/examples/allocator.rs b/examples/allocator.rs index e0a5ef4..0399ebb 100644 --- a/examples/allocator.rs +++ b/examples/allocator.rs @@ -14,11 +14,12 @@ #![no_main] #![no_std] +extern crate alloc; extern crate panic_halt; +use self::alloc::vec; use core::alloc::Layout; -use alloc::vec; use alloc_cortex_m::CortexMHeap; use cortex_m::asm; use cortex_m_rt::entry; @@ -40,6 +41,10 @@ fn main() -> ! { hprintln!("{:?}", xs).unwrap(); + // exit QEMU + // NOTE do not run this on hardware; it can corrupt OpenOCD state + debug::exit(debug::EXIT_SUCCESS); + loop {} }