Share native format and checkpoint source bytes
This commit is contained in:
1 parent
11c8ad1eaa
commit
c09d545da6
7 files changed
+44
-23
No files matched your search
@@ -208,7 +208,7 @@ pub struct Executor {
|
||||
line_break_cache: Option<std::sync::Arc<super::LineBreakCache>>,
|
||||
interaction_mode: u8,
|
||||
inputs: Vec<InputFrame>,
|
||||
sources: Vec<SourceFile>,
|
||||
sources: Vec<Arc<SourceFile>>,
|
||||
stream_sources: BTreeSet<usize>,
|
||||
generated_inputs: std::collections::BTreeMap<usize, GeneratedInput>,
|
||||
reads: BTreeSet<Dependency>,
|
||||
@@ -362,7 +362,7 @@ impl EntryCheckpoint {
|
||||
unreachable!("entry checkpoints start with the physical source frame");
|
||||
};
|
||||
mouth.rebind_loaded_prefix(source.data.clone());
|
||||
executor.sources[self.entry] = source;
|
||||
executor.sources[self.entry] = Arc::new(source);
|
||||
let result = executor
|
||||
.check_cancellation()
|
||||
.and_then(|_| executor.run_active_input(self.initial_depth, files, capture_boundary));
|
||||
@@ -472,7 +472,7 @@ impl Executor {
|
||||
executor.fresh_job = false;
|
||||
executor.job_name = execution.job_name;
|
||||
executor.interaction_mode = execution.interaction_mode;
|
||||
executor.sources = execution.sources;
|
||||
executor.sources = execution.sources.into_iter().map(Arc::new).collect();
|
||||
executor.stream_sources = execution.stream_sources;
|
||||
executor.generated_inputs = execution.generated_inputs;
|
||||
executor.split_discards = execution.split_discards;
|
||||
@@ -483,7 +483,7 @@ impl Executor {
|
||||
}
|
||||
pub(super) fn new_format_job(
|
||||
state: State,
|
||||
sources: Vec<SourceFile>,
|
||||
sources: Vec<Arc<SourceFile>>,
|
||||
stream_sources: BTreeSet<usize>,
|
||||
generated_inputs: std::collections::BTreeMap<usize, GeneratedInput>,
|
||||
limits: Limits,
|
||||
@@ -605,7 +605,7 @@ impl Executor {
|
||||
let mouth = Mouth::with_encoding(
|
||||
source, file.data.clone(), profile, &self.state.xe_default_encoding,
|
||||
);
|
||||
self.sources.push(file);
|
||||
self.sources.push(Arc::new(file));
|
||||
self.reads.insert(Dependency::Source(source));
|
||||
self.inputs.push(InputFrame::Source {
|
||||
source,
|
||||
@@ -2900,10 +2900,10 @@ impl Executor {
|
||||
.map_err(|e| self.error(e, self.current))?
|
||||
{
|
||||
let source = self.sources.len();
|
||||
self.sources.push(SourceFile {
|
||||
self.sources.push(Arc::new(SourceFile {
|
||||
name,
|
||||
data: Vec::new(),
|
||||
});
|
||||
}));
|
||||
self.stream_sources.insert(source);
|
||||
let xe_encoding = (self.state.input_profile() == InputProfile::XeTeX).then(|| {
|
||||
self.reads.insert(Dependency::XeDefaultInputEncoding);
|
||||
@@ -2968,7 +2968,7 @@ impl Executor {
|
||||
}
|
||||
let base = self.sources[source].data.len();
|
||||
let line = line.unwrap_or_default();
|
||||
self.sources[source].data.extend_from_slice(&line);
|
||||
Arc::make_mut(&mut self.sources[source]).data.extend_from_slice(&line);
|
||||
let end = self.sources[source].data.len();
|
||||
self.reads.insert(Dependency::EndLineChar);
|
||||
if readline {
|
||||
@@ -3306,7 +3306,7 @@ impl Executor {
|
||||
} else {
|
||||
ParagraphMode::Vertical
|
||||
},
|
||||
sources: self.sources,
|
||||
sources: self.sources.into_iter().map(Arc::unwrap_or_clone).collect(),
|
||||
stream_sources: self.stream_sources,
|
||||
generated_inputs: self.generated_inputs,
|
||||
reads: self.reads,
|
||||
@@ -3740,7 +3740,7 @@ impl Executor {
|
||||
})
|
||||
.collect();
|
||||
let evidence = ExecutionEvidence {
|
||||
sources: self.sources,
|
||||
sources: self.sources.into_iter().map(Arc::unwrap_or_clone).collect(),
|
||||
source_versions,
|
||||
stream_sources: self.stream_sources,
|
||||
generated_inputs: self.generated_inputs,
|
||||
@@ -3784,7 +3784,7 @@ impl Executor {
|
||||
io: self.io,
|
||||
input_position: self.input_position,
|
||||
paragraph_mode: ParagraphMode::Vertical,
|
||||
sources: self.sources,
|
||||
sources: self.sources.into_iter().map(Arc::unwrap_or_clone).collect(),
|
||||
stream_sources: self.stream_sources,
|
||||
generated_inputs: self.generated_inputs,
|
||||
reads: self.reads,
|
||||
|
||||
Reference in new issue
Block a user