Skip to content
Permalink
Browse files

expr-elimination (generalizaed intelligently to remove the `for` loop…

… too).
  • Loading branch information
pnkfelix committed Nov 16, 2019
1 parent b9abaf6 commit 4b60bdd00f670d55c3508ad5cee9d1f4778e361d
Showing with 2 additions and 16 deletions.
  1. +2 −16 tock/kernel/src/lib.rs
@@ -2586,31 +2586,17 @@ pub fn load_processes<C: Chip>(
let mut apps_in_flash_ptr = start_of_flash;
let mut app_memory_ptr = app_memory.as_mut_ptr();
let mut app_memory_size = app_memory.len();
for i in 0..procs.len() {
unsafe {
let (process, flash_offset, memory_offset) = Process::create(
Process::create(
kernel,
chip,
apps_in_flash_ptr,
app_memory_ptr,
app_memory_size,
fault_response,
i,
0,
);

if process.is_none() {
if flash_offset == 0 && memory_offset == 0 {
break;
}
} else {
procs[i] = process;
}

apps_in_flash_ptr = apps_in_flash_ptr.add(flash_offset);
app_memory_ptr = app_memory_ptr.add(memory_offset);
app_memory_size -= memory_offset;
}
}
}


0 comments on commit 4b60bdd

Please sign in to comment.
You can’t perform that action at this time.