Skip to content

Commit

Permalink
kernel: process: do not store ref to process name
Browse files Browse the repository at this point in the history
  • Loading branch information
bradjc committed Jul 3, 2024
1 parent 9d1f488 commit 3c74632
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions kernel/src/process_standard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -230,9 +230,6 @@ pub struct ProcessStandard<'a, C: 'static + Chip> {
/// be stored as `Some(completion code)`.
completion_code: OptionalCell<Option<u32>>,

/// Name of the app.
process_name: &'static str,

/// Values kept so that we can print useful debug messages when apps fault.
debug: MapCell<ProcessStandardDebug>,
}
Expand Down Expand Up @@ -374,7 +371,7 @@ impl<C: Chip> Process for ProcessStandard<'_, C> {
FaultAction::Panic => {
// process faulted. Panic and print status
self.state.set(State::Faulted);
panic!("Process {} had a fault", self.process_name);
panic!("Process {} had a fault", self.get_process_name());
}
FaultAction::Restart => {
self.try_restart(None);
Expand Down Expand Up @@ -996,7 +993,7 @@ impl<C: Chip> Process for ProcessStandard<'_, C> {
}

fn get_process_name(&self) -> &'static str {
self.process_name
self.header.get_package_name().unwrap_or("")
}

fn get_completion_code(&self) -> Option<Option<u32>> {
Expand Down Expand Up @@ -1691,7 +1688,6 @@ impl<C: 'static + Chip> ProcessStandard<'_, C> {
Cell::new(None),
];
process.tasks = MapCell::new(tasks);
process.process_name = process_name.unwrap_or("");

process.debug = MapCell::new(ProcessStandardDebug {
fixed_address_flash,
Expand Down

0 comments on commit 3c74632

Please sign in to comment.