• Home
  • Raw
  • Download

Lines Matching +full:safe +full:- +full:regex

1 // This module provides a relatively simple thread-safe pool of reusable
25 // case of the first-to-get thread.
29 // thread_local and find a way to *simply* re-capture some of its speed for
30 // regex's specific case. So again, why move off of it? The *primary* reason is
31 // because of memory leaks. See https://github.com/rust-lang/regex/issues/362
33 // "use as much safe code as possible to minimize risk and be as sure as I can
37 // regex since its memory usage scales to the number of active threads that
38 // have used a regex, where as the pool below scales to the number of threads
39 // that simultaneously use a regex. While neither case permits contraction,
43 // sitting around that might have used a regex at one point. While thread_local
53 // https://github.com/BurntSushi/rure-go/issues/3. And in particular, users
58 // like regex, maintenance can be simpler when we own the full dependency tree.
81 panic!("regex: thread ID allocation space exhausted");
90 Box<dyn Fn() -> T + Send + Sync + UnwindSafe + RefUnwindSafe + 'static>;
92 /// A simple thread safe pool for reusing values.
131 // The only non-sync aspect of a Pool is its 'owner_val' field, which is used
142 // is safe to declare that Pool<T> is Sync when T is Send.
149 // If there is a way to achieve our performance goals using safe code, then
151 // tries to balance safety with performance. The case where a Regex is used
157 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { in fmt()
182 pub fn new(create: CreateFn<T>) -> Pool<T> { in new()
195 #[cfg_attr(feature = "perf-inline", inline(always))]
196 pub fn get(&self) -> PoolGuard<'_, T> { in get()
220 fn get_slow(&self, caller: usize, owner: usize) -> PoolGuard<'_, T> { in get_slow()
250 fn guard_owned(&self) -> PoolGuard<'_, T> { in guard_owned()
255 fn guard_stack(&self, value: Box<T>) -> PoolGuard<'_, T> { in guard_stack()
262 pub fn value(&self) -> &T { in value()
271 #[cfg_attr(feature = "perf-inline", inline(always))]