regex_automata::util

Module pool

source
Available on crate feature alloc only.
Expand description

A thread safe memory pool.

The principal type in this module is a Pool. It main use case is for holding a thread safe collection of mutable scratch spaces (usually called Cache in this crate) that regex engines need to execute a search. This then permits sharing the same read-only regex object across multiple threads while having a quick way of reusing scratch space in a thread safe way. This avoids needing to re-create the scratch space for every search, which could wind up being quite expensive.

Structsยง

  • A thread safe pool that works in an alloc-only context.
  • A guard that is returned when a caller requests a value from the pool.