libsupport_zynq/ram: split allocator for each core. #47

Closed
pca006132 wants to merge 2 commits from pca006132:separate-alloc into master
1 changed files with 7 additions and 1 deletions
Showing only changes of commit 1bb0122034 - Show all commits

View File

@ -90,5 +90,11 @@ pub fn init_alloc_core1() {
#[alloc_error_handler]
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());
}