1use std::{
17 cell::{Cell, RefCell},
18 hash::BuildHasherDefault,
19 ops::Deref,
20 rc::Rc,
21};
22
23use rustc_hash::{FxHashMap, FxHasher};
24use string_interner::{StringInterner, Symbol, backend::BufferBackend};
25
26pub mod data;
27pub use data::{SymHashMap, SymStr};
28
29type Interner = StringInterner<BufferBackend, BuildHasherDefault<FxHasher>>;
30
31thread_root! {
32fn arena_root() -> RefCell<Interner> = {
33 RefCell::new(new_interner())
44};
45}
46
47fn new_interner() -> Interner {
48 StringInterner::with_capacity_and_hasher(131_072, BuildHasherDefault::<FxHasher>::default())
49}
50
51const OVERFLOW_SLOTS: usize = 1 << 24;
54const OVERFLOW_BASE: usize = u32::MAX as usize - OVERFLOW_SLOTS;
57
58thread_local! {
59 static BUFFER_LEN: Cell<usize> = const { Cell::new(0) };
62}
63
64#[derive(Default)]
66struct Overflow {
67 texts: Vec<Rc<str>>,
68 symbols: FxHashMap<Rc<str>, SymStr>,
69 fresh: usize,
71}
72
73thread_root! {
74fn overflow_root() -> RefCell<Overflow> = RefCell::default();
75}
76
77#[inline(never)]
79fn page_symbol(text: &str) -> Option<SymStr> { overflow_root().borrow().symbols.get(text).copied() }
80
81#[inline]
83fn in_buffer(sym: SymStr) -> SymStr {
84 assert!(
85 sym.to_usize() < OVERFLOW_BASE,
86 "a symbol of the string arena's buffer reached the overflow page's"
87 );
88 sym
89}
90
91#[inline]
94fn push(arena: &mut Interner, text: &str) -> SymStr {
95 let start = BUFFER_LEN.get();
96 let Some(end) = buffer_end(start, text.len()) else {
97 buffer_full()
98 };
99 let sym = arena.get_or_intern(text);
100 debug_assert_eq!(
101 sym.to_usize(),
102 start,
103 "the buffer's length went out of step"
104 );
105 BUFFER_LEN.set(end);
106 sym
107}
108
109#[inline]
112fn buffer_end(start: usize, len: usize) -> Option<usize> {
113 let prefix = (usize::BITS - len.leading_zeros()).div_ceil(7).max(1) as usize;
114 Some(start.saturating_add(prefix).saturating_add(len)).filter(|end| *end <= OVERFLOW_BASE)
115}
116
117#[cold]
118#[inline(never)]
119fn buffer_full() -> ! {
120 panic!(
121 "the string arena is full: this conversion interned about 4 GiB of distinct strings (names, labels, file paths, \
122 numbers), the most one run can hold"
123 )
124}
125
126#[inline]
127fn intern(text: &str) -> SymStr {
128 if let Ok(mut arena) = arena_root().try_borrow_mut() {
129 if let Some(sym) = arena.get(text) {
130 return in_buffer(sym);
131 }
132 return page_symbol(text).unwrap_or_else(|| push(&mut arena, text));
134 }
135 intern_cold(text)
136}
137
138#[cold]
141#[inline(never)]
142fn intern_cold(text: &str) -> SymStr {
143 if let Some(sym) = arena_root().borrow().get(text) {
144 return in_buffer(sym);
145 }
146 let mut overflow = overflow_root().borrow_mut();
147 if let Some(&sym) = overflow.symbols.get(text) {
148 return sym;
149 }
150 let sym = page_slot(overflow.texts.len());
151 let text: Rc<str> = Rc::from(text);
152 overflow.texts.push(Rc::clone(&text));
153 overflow.symbols.insert(text, sym);
154 overflow.fresh += 1;
155 sym
156}
157
158fn page_slot(index: usize) -> SymStr {
161 assert!(index < OVERFLOW_SLOTS, "the arena's overflow page is full");
162 SymStr::try_from_usize(OVERFLOW_BASE + index).expect("an overflow symbol is a SymbolU32")
163}
164
165enum Text<'a> {
167 Buffer(&'a str),
168 Page(Rc<str>),
169}
170
171impl Deref for Text<'_> {
172 type Target = str;
173 #[inline]
174 fn deref(&self) -> &str {
175 match self {
176 Text::Buffer(text) => text,
177 Text::Page(text) => text,
178 }
179 }
180}
181
182#[inline]
183fn text(arena: &Interner, sym: SymStr) -> Text<'_> {
184 if is_paged(sym) {
185 Text::Page(page_text(sym))
186 } else {
187 Text::Buffer(buffer_text(arena, sym))
188 }
189}
190
191#[inline]
192fn is_paged(sym: SymStr) -> bool { sym.to_usize() >= OVERFLOW_BASE }
193
194#[inline]
196fn buffer_text(arena: &Interner, sym: SymStr) -> &str {
197 assert!(
198 !is_paged(sym),
199 "an overflow symbol resolved in the arena's buffer"
200 );
201 unsafe { arena.resolve_unchecked(sym) }
205}
206
207#[cold]
208#[inline(never)]
209fn page_text(sym: SymStr) -> Rc<str> {
210 Rc::clone(&overflow_root().borrow().texts[sym.to_usize() - OVERFLOW_BASE])
211}
212
213pub fn pin_static(text: &'static str) -> SymStr { intern(text) }
215
216thread_static! {
217 static PINNED_SITES: RefCell<Vec<&'static std::thread::LocalKey<Cell<Option<SymStr>>>>> =
222 RefCell::new(Vec::new());
223}
224
225#[doc(hidden)]
228#[cold]
229#[inline(never)]
230pub fn pin_site(
231 site: &'static std::thread::LocalKey<Cell<Option<SymStr>>>,
232 text: &'static str,
233) -> SymStr {
234 let sym = pin_static(text);
235 site.with(|c| c.set(Some(sym)));
236 PINNED_SITES.borrow_mut().push(site);
237 sym
238}
239
240#[macro_export]
261macro_rules! pin {
262 ($s:literal) => {{
263 std::thread_local! {
264 static CACHED: std::cell::Cell<Option<$crate::common::arena::SymStr>> =
265 const { std::cell::Cell::new(None) };
266 }
267 match CACHED.with(std::cell::Cell::get) {
268 Some(sym) => sym,
269 None => $crate::common::arena::pin_site(&CACHED, $s),
270 }
271 }};
272 (concat!($($part:literal),+ $(,)?)) => {{
273 std::thread_local! {
274 static CACHED: std::cell::Cell<Option<$crate::common::arena::SymStr>> =
275 const { std::cell::Cell::new(None) };
276 }
277 match CACHED.with(std::cell::Cell::get) {
278 Some(sym) => sym,
279 None => $crate::common::arena::pin_site(&CACHED, concat!($($part),+)),
280 }
281 }};
282}
283
284pub fn pin<S: AsRef<str>>(text: S) -> SymStr { intern(text.as_ref()) }
291
292pub fn get<S: AsRef<str>>(text: S) -> Option<SymStr> {
298 let text = text.as_ref();
299 let found = arena_root().borrow().get(text).map(in_buffer);
300 found.or_else(|| page_symbol(text))
301}
302
303thread_static! {
304 static SUFFIXED_KEY: RefCell<String> = RefCell::new(String::new());
307}
308
309pub fn get_suffixed(name: &str, suffix: &str) -> Option<SymStr> {
312 let mut key = SUFFIXED_KEY.borrow_mut();
313 key.clear();
314 key.push_str(name);
315 key.push_str(suffix);
316 get(key.as_str())
317}
318
319pub fn pin_qname(prefix: &str, local: &str) -> SymStr {
322 let mut key = SUFFIXED_KEY.borrow_mut();
323 key.clear();
324 key.push_str(prefix);
325 key.push(':');
326 key.push_str(local);
327 pin(key.as_str())
328}
329
330thread_static! {
331 static ASCII_CHAR_SYM: [Cell<u32>; 128] = [const { Cell::new(u32::MAX) }; 128];
340}
341
342pub fn pin_char(c: char) -> SymStr {
343 let code = c as u32;
344 if code < 128 {
345 let cached = ASCII_CHAR_SYM[code as usize].get();
346 if cached != u32::MAX {
347 return SymStr::try_from_usize(cached as usize).expect("invalid cached ASCII SymStr");
349 }
350 }
351 let sym = {
352 let mut tmp = [0u8; 4];
353 let s = c.encode_utf8(&mut tmp);
354 pin(s)
355 };
356 if code < 128 {
357 ASCII_CHAR_SYM[code as usize].set(sym.to_usize() as u32);
358 }
359 sym
360}
361
362#[inline]
367pub fn with<R, FnR>(sym: SymStr, caller: FnR) -> R
368where FnR: FnOnce(&str) -> R {
369 let arena = arena_root().borrow();
370 let page;
372 let text = if is_paged(sym) {
373 page = page_text(sym);
374 &*page
375 } else {
376 buffer_text(&arena, sym)
377 };
378 caller(text)
379}
380
381#[inline]
383pub fn first_bytes<const N: usize>(sym: SymStr) -> Option<[u8; N]> {
384 with(sym, |text| text.as_bytes().first_chunk().copied())
385}
386
387pub fn with2<R, FnR>(sym1: SymStr, sym2: SymStr, caller: FnR) -> R
388where FnR: FnOnce(&str, &str) -> R {
389 let arena = arena_root().borrow();
390 caller(&text(&arena, sym1), &text(&arena, sym2))
391}
392
393pub fn with3<R, FnR>(sym1: SymStr, sym2: SymStr, sym3: SymStr, caller: FnR) -> R
394where FnR: FnOnce(&str, &str, &str) -> R {
395 let arena = arena_root().borrow();
396 caller(
397 &text(&arena, sym1),
398 &text(&arena, sym2),
399 &text(&arena, sym3),
400 )
401}
402
403pub fn with_many<R, FnR>(syms: &[SymStr], caller: FnR) -> R
404where FnR: FnOnce(Vec<&str>) -> R {
405 let arena = arena_root().borrow();
406 let texts: Vec<Text> = syms.iter().map(|sym| text(&arena, *sym)).collect();
407 caller(texts.iter().map(|text| &**text).collect())
408}
409
410pub fn to_string(sym: SymStr) -> String { with(sym, str::to_owned) }
411
412pub fn join(syms: &[SymStr], sep: &str) -> String { with_many(syms, |strs| strs.join(sep)) }
413
414pub fn len() -> usize { arena_root().borrow().len() + overflow_root().borrow().texts.len() }
415
416pub fn take_overflow_interns() -> usize { std::mem::take(&mut overflow_root().borrow_mut().fresh) }
419
420pub fn reset() {
439 *arena_root()
441 .try_borrow_mut()
442 .expect("arena::reset inside a lend (`arena::with`): the lent text would dangle") =
443 new_interner();
444 *overflow_root().borrow_mut() = Overflow::default();
445 BUFFER_LEN.set(0);
446 for cached in &*ASCII_CHAR_SYM {
450 cached.set(u32::MAX);
451 }
452 for site in PINNED_SITES.borrow_mut().drain(..) {
453 site.with(|c| c.set(None));
454 }
455 *SUFFIXED_KEY.borrow_mut() = String::new();
456}
457
458pub fn shrink() {
461 reset();
462 *arena_root().borrow_mut() =
463 StringInterner::with_hasher(BuildHasherDefault::<FxHasher>::default());
464 *PINNED_SITES.borrow_mut() = Vec::new();
466}
467
468#[cfg(test)]
470pub(crate) fn buffer_len() -> usize { BUFFER_LEN.get() }
471
472pub(crate) fn force_init() { arena_root(); }
486
487#[cfg(test)]
488mod tests {
489 use super::*;
490
491 #[test]
492 fn pin_literal_cache_follows_an_arena_reset() {
493 fn cached() -> SymStr { pin!("a literal pinned at a call site") }
494 assert_eq!(to_string(cached()), "a literal pinned at a call site");
495 reset();
496 pin("another string");
498 assert_eq!(to_string(cached()), "a literal pinned at a call site");
499 }
500
501 #[test]
502 fn pin_char_cache_follows_an_arena_reset() {
503 assert_eq!(to_string(pin_char('~')), "~");
504 reset();
505 pin("not a tilde");
507 assert_eq!(to_string(pin_char('~')), "~");
508 }
509
510 #[test]
511 fn pin_dedups_equal_strings() {
512 let a = pin("arena_test_foo");
513 let b = pin("arena_test_foo");
514 assert_eq!(a, b, "equal strings must return the same SymStr");
515 }
516
517 #[test]
518 fn pin_distinguishes_different_strings() {
519 let a = pin("arena_test_bar");
520 let b = pin("arena_test_baz");
521 assert_ne!(a, b);
522 }
523
524 #[test]
525 fn pin_static_matches_pin() {
526 let a = pin_static("arena_test_qux");
527 let b = pin("arena_test_qux");
528 assert_eq!(a, b, "pin_static and pin should intern to the same SymStr");
529 }
530
531 #[test]
532 fn to_string_roundtrips() {
533 let sym = pin("arena_test_quux");
534 assert_eq!(to_string(sym), "arena_test_quux");
535 }
536
537 #[test]
538 fn with_borrows_without_allocating() {
539 let sym = pin("arena_test_corge");
540 let len = with(sym, |s| s.len());
541 assert_eq!(len, "arena_test_corge".len());
542 }
543
544 #[test]
545 fn with_predicate_returns_bool() {
546 let sym = pin("arena_test_predicate");
547 let starts_with = with(sym, |s| s.starts_with("arena"));
548 assert!(starts_with);
549 }
550
551 #[test]
552 fn reset_empties_interner_and_stays_usable() {
553 let _ = pin("arena_reset_alpha");
556 let _ = pin("arena_reset_beta");
557 assert!(len() >= 2, "expected the two pins to be interned");
558 reset();
559 assert_eq!(len(), 0, "reset must return the interner to empty");
560 let s = pin("arena_reset_gamma");
562 assert_eq!(to_string(s), "arena_reset_gamma");
563 }
564
565 #[test]
566 fn pin_char_ascii_roundtrips() {
567 let sym = pin_char('a');
568 assert_eq!(to_string(sym), "a");
569 let sym2 = pin_char('a');
570 assert_eq!(sym, sym2, "ASCII char pin is cached");
571 }
572
573 #[test]
574 fn pin_char_distinct_chars_distinct_syms() {
575 assert_ne!(pin_char('a'), pin_char('b'));
576 assert_ne!(pin_char('0'), pin_char('1'));
577 }
578
579 #[test]
580 fn pin_char_unicode_roundtrips() {
581 let sym = pin_char('π');
583 assert_eq!(to_string(sym), "π");
584 }
585
586 #[test]
587 fn join_concatenates_with_separator() {
588 let a = pin("arena_test_alpha");
589 let b = pin("arena_test_beta");
590 let c = pin("arena_test_gamma");
591 let out = join(&[a, b, c], ",");
592 assert_eq!(out, "arena_test_alpha,arena_test_beta,arena_test_gamma");
593 }
594
595 #[test]
596 fn pin_macro_caches_per_site() {
597 let a = pin!("arena_test_literal");
601 let b = pin!("arena_test_literal");
602 assert_eq!(a, b, "same literal at different call sites → same SymStr");
603 }
604
605 #[test]
608 fn lend_survives_interning_many_new_strings() {
609 reset();
611 let lent = pin("arena_lend_text");
612 let read = with(lent, |text| {
613 for i in 0..3000 {
614 pin(format!("arena_lend_new_{i}"));
615 }
616 text.to_owned()
617 });
618 assert_eq!(read, "arena_lend_text");
619 for i in [0, 1499, 2999] {
620 let sym = get(format!("arena_lend_new_{i}")).expect("interned under the lend");
621 assert_eq!(to_string(sym), format!("arena_lend_new_{i}"));
622 }
623 assert_eq!(take_overflow_interns(), 3000);
624 assert_eq!(take_overflow_interns(), 0, "the count is read once");
625 }
626
627 #[test]
632 #[cfg_attr(miri, ignore)]
633 fn lend_survives_more_new_bytes_than_the_buffer_holds() {
634 reset();
635 let lent = pin("arena_move_text");
636 let filler = "x".repeat(1 << 15);
637 let count = 131_072 * 13 / filler.len() + 2;
638 let (read, unmoved) = with(lent, |text| {
639 let at = text.as_ptr();
640 for i in 0..count {
641 pin(format!("{i}{filler}"));
642 }
643 (text.to_owned(), with(lent, |again| again.as_ptr()) == at)
644 });
645 assert_eq!(read, "arena_move_text");
646 assert!(unmoved, "the buffer moved under the lend");
647 assert_eq!(
648 to_string(pin(format!("{}{filler}", count - 1))).len(),
649 filler.len() + 2
650 );
651 assert_eq!(take_overflow_interns(), count);
652 }
653
654 #[test]
656 fn nested_lends_and_a_pin_of_an_existing_string() {
657 let outer = pin("arena_nest_outer");
658 let inner = pin("arena_nest_inner");
659 let joined = with(outer, |o| {
660 with2(inner, outer, |i, o2| {
661 assert_eq!(
662 pin("arena_nest_inner"),
663 inner,
664 "an existing string keeps its symbol under a lend"
665 );
666 format!("{o}/{i}/{o2}/{}", to_string(inner))
667 })
668 });
669 assert_eq!(
670 joined,
671 "arena_nest_outer/arena_nest_inner/arena_nest_outer/arena_nest_inner"
672 );
673 assert_eq!(take_overflow_interns(), 0, "no string was new");
674 }
675
676 #[test]
678 fn get_under_a_lend() {
679 let lent = pin("arena_get_lent");
680 let before = len();
681 let (buffered, paged, absent) = with(lent, |_| {
682 let paged = pin("arena_get_paged");
683 (
684 get("arena_get_lent"),
685 (paged, get("arena_get_paged")),
686 get("arena_get_absent"),
687 )
688 });
689 assert_eq!(buffered, Some(lent));
690 assert_eq!(paged.1, Some(paged.0));
691 assert_eq!(absent, None);
692 assert_eq!(len(), before + 1);
693 }
694
695 #[test]
698 fn an_overflow_string_dedups_across_tiers() {
699 reset();
700 let lent = pin("arena_dedup_lent");
701 let paged = with(lent, |_| pin("arena_dedup_paged"));
702 assert_eq!(
703 pin("arena_dedup_paged"),
704 paged,
705 "the later pin outside the lend finds the overflow string"
706 );
707 assert_eq!(pin_static("arena_dedup_paged"), paged);
708 assert_eq!(get("arena_dedup_paged"), Some(paged));
709 assert_eq!(to_string(paged), "arena_dedup_paged");
710 assert_eq!(first_bytes::<3>(paged), Some(*b"are"));
711 assert_eq!(
712 with3(lent, paged, lent, |a, b, c| format!("{a}{b}{c}")),
713 "arena_dedup_lentarena_dedup_pagedarena_dedup_lent"
714 );
715 assert_eq!(
716 join(&[paged, lent], ","),
717 "arena_dedup_paged,arena_dedup_lent"
718 );
719 let buffered = pin("arena_dedup_after");
721 assert!(!is_paged(buffered));
722 assert_eq!(to_string(buffered), "arena_dedup_after");
723 assert_eq!(take_overflow_interns(), 1);
724 }
725
726 #[test]
728 fn reset_clears_the_overflow_page() {
729 reset();
730 let lent = pin("arena_reset_lent");
731 let paged = with(lent, |_| pin("arena_reset_paged"));
732 assert_eq!(len(), 2);
733 reset();
734 assert_eq!(len(), 0);
735 assert_eq!(get("arena_reset_paged"), None);
736 assert_eq!(take_overflow_interns(), 0);
737 let lent = pin("arena_reset_lent2");
738 assert_eq!(
739 with(lent, |_| pin("arena_reset_paged2")),
740 paged,
741 "the first overflow symbol again"
742 );
743 assert_eq!(to_string(paged), "arena_reset_paged2");
744 }
745
746 #[test]
749 fn buffer_symbols_reach_past_2_gib() {
750 for at in [1 << 31, OVERFLOW_BASE - 1] {
751 let sym = SymStr::try_from_usize(at).unwrap();
752 assert_eq!(in_buffer(sym), sym);
753 assert!(!is_paged(sym), "{at} is a buffer symbol");
754 }
755 assert_eq!(
756 OVERFLOW_BASE,
757 (1 << 32) - 1 - (1 << 24),
758 "the buffer's ceiling is near 4 GiB"
759 );
760 assert!(is_paged(SymStr::try_from_usize(OVERFLOW_BASE).unwrap()));
761 let last = SymStr::try_from_usize(u32::MAX as usize - 1).unwrap();
763 assert!(is_paged(last));
764 assert_eq!(SymStr::try_from_usize(u32::MAX as usize), None);
765 }
766
767 #[test]
769 fn overflow_symbols_start_at_the_page_base() {
770 reset();
771 let lent = pin("arena_base_lent");
772 let [first, second] = with(lent, |_| {
773 [pin("arena_base_first"), pin("arena_base_second")]
774 });
775 assert_eq!(
776 (first.to_usize(), second.to_usize()),
777 (OVERFLOW_BASE, OVERFLOW_BASE + 1)
778 );
779 assert!(first.to_usize() > 1 << 31);
780 assert_eq!(to_string(first), "arena_base_first");
781 assert_eq!(with(second, str::to_owned), "arena_base_second");
782 let buffered = pin("arena_base_buffered");
783 assert!(buffered.to_usize() < OVERFLOW_BASE);
784 assert_eq!(to_string(buffered), "arena_base_buffered");
785 }
786
787 #[test]
790 fn a_full_buffer_refuses_a_new_string() {
791 reset();
792 let held = pin("arena_full_held");
793 BUFFER_LEN.set(OVERFLOW_BASE - 15);
795 let refused =
796 std::panic::catch_unwind(|| pin("arena_full_new0")).expect_err("the buffer is full");
797 assert!(
798 refused
799 .downcast_ref::<&str>()
800 .is_some_and(|m| m.starts_with("the string arena is full"))
801 );
802 assert_eq!(get("arena_full_new0"), None);
803 assert_eq!(BUFFER_LEN.get(), OVERFLOW_BASE - 15);
804 assert_eq!(pin("arena_full_held"), held);
805 assert_eq!(to_string(held), "arena_full_held");
806 let paged = with(held, |_| pin("arena_full_paged"));
807 assert!(is_paged(paged));
808 assert_eq!(to_string(paged), "arena_full_paged");
809 reset();
810 }
811
812 #[test]
815 fn the_buffer_ends_at_the_overflow_base() {
816 assert_eq!(buffer_end(OVERFLOW_BASE - 15, 14), Some(OVERFLOW_BASE));
817 assert_eq!(buffer_end(OVERFLOW_BASE - 15, 15), None);
818 assert_eq!(buffer_end(OVERFLOW_BASE - 1, 0), Some(OVERFLOW_BASE));
819 assert_eq!(buffer_end(OVERFLOW_BASE, 0), None);
820 assert_eq!(buffer_end(OVERFLOW_BASE - 100, OVERFLOW_SLOTS), None);
822 assert_eq!(buffer_end(usize::MAX - 1, 5), None);
823 }
824
825 #[test]
828 fn the_buffer_length_follows_its_strings() {
829 reset();
830 for (len, prefix) in [
831 (0, 1),
832 (1, 1),
833 (127, 1),
834 (128, 2),
835 (16_383, 2),
836 (16_384, 3),
837 (70_000, 3),
838 ] {
839 let start = BUFFER_LEN.get();
840 assert_eq!(pin("y".repeat(len)).to_usize(), start);
841 assert_eq!(BUFFER_LEN.get(), start + prefix + len);
842 }
843 let end = BUFFER_LEN.get();
844 assert_eq!(pin("arena_len_next").to_usize(), end);
845 }
846
847 #[test]
849 fn the_overflow_page_ends_at_the_largest_symbol() {
850 assert_eq!(page_slot(0).to_usize(), OVERFLOW_BASE);
851 assert_eq!(
852 page_slot(OVERFLOW_SLOTS - 1).to_usize(),
853 u32::MAX as usize - 1
854 );
855 let full =
856 std::panic::catch_unwind(|| page_slot(OVERFLOW_SLOTS)).expect_err("the page is full");
857 assert_eq!(
858 full.downcast_ref::<&str>(),
859 Some(&"the arena's overflow page is full")
860 );
861 }
862
863 #[test]
865 #[should_panic(expected = "arena::reset inside a lend")]
866 fn reset_inside_a_lend_panics() {
867 let lent = pin("arena_reset_inside");
868 with(lent, |_| reset());
869 }
870
871 #[test]
873 #[should_panic(expected = "arena::reset inside a lend")]
874 fn reset_inside_an_overflow_lend_panics() {
875 let lent = pin("arena_reset_inside_page");
876 let paged = with(lent, |_| pin("arena_reset_inside_paged"));
877 with(paged, |_| reset());
878 }
879}