Skip to content

Commit

Permalink
expr-elimination (generalizaed intelligently to remove the for loop…
Browse files Browse the repository at this point in the history
… too).
  • Loading branch information
pnkfelix committed Nov 16, 2019
1 parent b9abaf6 commit 4b60bdd
Showing 1 changed file with 2 additions and 16 deletions.
18 changes: 2 additions & 16 deletions tock/kernel/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
}


Expand Down

0 comments on commit 4b60bdd

Please sign in to comment.