libsupport_zynq/ram: print heap usage on alloc error.
This commit is contained in:
parent
c0c3bcb6cc
commit
1bb0122034
|
@ -90,5 +90,11 @@ pub fn init_alloc_core1() {
|
||||||
|
|
||||||
#[alloc_error_handler]
|
#[alloc_error_handler]
|
||||||
fn alloc_error(layout: core::alloc::Layout) -> ! {
|
fn alloc_error(layout: core::alloc::Layout) -> ! {
|
||||||
panic!("Core {} alloc_error, layout: {:?}", MPIDR.read().cpu_id(), layout);
|
let id = MPIDR.read().cpu_id();
|
||||||
|
let heap = if id == 0 {
|
||||||
|
ALLOCATOR.0.lock()
|
||||||
|
} else {
|
||||||
|
ALLOCATOR.1.lock()
|
||||||
|
};
|
||||||
|
panic!("Core {} alloc_error, layout: {:?}, used memory: {}", id, layout, heap.used());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue