mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-05-29 18:51:15 -03:00
Make Job store boxed process list instead of Vec
This commit is contained in:
@@ -1835,7 +1835,7 @@ fn populate_job_from_job_node(
|
||||
if result == EndExecutionReason::ok {
|
||||
// Link up the processes.
|
||||
assert!(!processes.is_empty());
|
||||
*j.processes_mut() = processes;
|
||||
*j.processes_mut() = processes.into_boxed_slice();
|
||||
}
|
||||
result
|
||||
}
|
||||
|
||||
10
src/proc.rs
10
src/proc.rs
@@ -791,7 +791,7 @@ pub struct Job {
|
||||
command_str: WString,
|
||||
|
||||
/// All the processes in this job.
|
||||
pub processes: Vec<Process>,
|
||||
pub processes: Box<[Process]>,
|
||||
|
||||
// The group containing this job.
|
||||
// This is never cleared.
|
||||
@@ -824,15 +824,13 @@ pub fn command(&self) -> &wstr {
|
||||
&self.command_str
|
||||
}
|
||||
|
||||
/// Borrow the job's process list. Only read-only or interior mutability actions may be
|
||||
/// performed on the processes in the list.
|
||||
/// Borrow the job's process list.
|
||||
pub fn processes(&self) -> &[Process] {
|
||||
&self.processes
|
||||
}
|
||||
|
||||
/// Get mutable access to the job's process list.
|
||||
/// Only available with a mutable reference `&mut Job`.
|
||||
pub fn processes_mut(&mut self) -> &mut Vec<Process> {
|
||||
/// Get the mutable list of processes.
|
||||
pub fn processes_mut(&mut self) -> &mut Box<[Process]> {
|
||||
&mut self.processes
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user