Share native format and checkpoint source bytes

This commit is contained in:
gloamxun committed 2026-11-28 23:16:20 +08:00
1 parent 11c8ad1eaa
commit c09d545da6
7 files changed
+44 -23

No files matched your search

@@ -1,5 +1,5 @@
use super::{CatCode, CommandName, Dependency, Span, State, Token, TokenKind};
use std::collections::BTreeSet;
use std::{collections::BTreeSet, sync::Arc};
use super::xe_encoding::{Character, Encoding};
@@ -282,7 +282,7 @@ enum LineBreaks {
#[derive(Clone)]
pub(super) struct Mouth {
source: usize,
data: Vec<u8>,
data: Arc<Vec<u8>>,
profile: super::InputProfile,
offset: usize,
line: Vec<Character>,
@@ -321,7 +321,7 @@ impl Mouth {
}
pub(super) fn rebind_loaded_prefix(&mut self, data: Vec<u8>) {
debug_assert!(self.matches_loaded_prefix(&data));
self.data = data;
self.data = Arc::new(data);
}
pub(super) fn payload_bytes(&self) -> usize {
self.data.len()
@@ -351,7 +351,7 @@ impl Mouth {
};
Self {
source,
data,
data: Arc::new(data),
profile,
offset,
line: Vec::new(),