REAL
Regular Expression Algorithmic Library — constexpr C++20 regex
Loading...
Searching...
No Matches
real::detail::static_pike_scratch< CodeSize, SlotCount, WantsIL > Struct Template Reference

Compile-time-storage VM scratch, all fixed-capacity (zero heap), keyed on DIMENSIONS ONLY. More...

#include <storage.hpp>

Inheritance diagram for real::detail::static_pike_scratch< CodeSize, SlotCount, WantsIL >:
[legend]
Collaboration diagram for real::detail::static_pike_scratch< CodeSize, SlotCount, WantsIL >:
[legend]

Public Attributes

basic_capture_pool< static_vec< std::size_t, max_blocks *SlotCount >, static_vec< std::int32_t, max_blocks >, static_vec< std::uint32_t, max_blocks > > pool
 COW capture blocks (zero heap).
 
- Public Attributes inherited from real::detail::basic_pike_state< basic_thread_list< static_vec< std::int32_t, CodeSize >, static_vec< std::size_t, CodeSize >, static_vec< std::uint64_t, CodeSize > >, static_vec< eps_entry,(3 *CodeSize)+4 > >
basic_thread_list< static_vec< std::int32_t, CodeSize >, static_vec< std::size_t, CodeSize >, static_vec< std::uint64_t, CodeSize > > list_a
 One of the two thread lists; the run rotates pointers, not indices.
 
basic_thread_list< static_vec< std::int32_t, CodeSize >, static_vec< std::size_t, CodeSize >, static_vec< std::uint64_t, CodeSize > > list_b
 The other one — see list_a.
 
static_vec< eps_entry,(3 *CodeSize)+4 > stack
 Epsilon-closure DFS stack.
 
std::int32_t table_class
 Class table was built for (-1 = none). One load per byte instead of the bitmap's shift-and-mask, reused across a find_all-style walk.
 
std::array< std::uint8_t, 256 > table
 1 where the byte is in table_class (filled on a class_table miss).
 
std::int32_t cp_page_class
 Class cp_page was built for (-1 = none): the 2-byte UTF-8 range [U+0080, U+07FF] in one load from 240 bytes. Higher code points use cp_hi_table, since widening the bitmap would inflate every pattern's hot state and slow the ASCII class loop.
 
std::array< std::uint64_t, 30 > cp_page
 1 where the code point (U+0080..U+07FF) is a member (filled on a cp_page_table miss).
 
const void * rows_verified_for
 Program whose membership rows this state verified as filled; spares class_table's two acquire loads per run().
 
const std::uint8_t * row_ptr
 The verified byte row, cached for the hot path.
 
const std::uint64_t * page_ptr
 As row_ptr, for the two-byte page bitmap.
 
std::int32_t hi_class
 Class hi_ptr / hi_never were resolved for; -1 while unresolved.
 
const cp_hi_table * hi_ptr
 The resolved sparse hi table for hi_class, or null when it has none usable.
 
bool hi_never
 Set when hi_class has no high ranges at all, so every cp past the page bitmap misses.
 

Static Public Attributes

static constexpr std::size_t max_blocks {(5 * CodeSize) + 8}
 Worst-case live capture blocks: every reference (a DFS stack frame or a thread in either list) could point at a distinct block, and the stack is (3*CodeSize)+4 with each list holding up to CodeSize threads; freed blocks recycle. Derived from the tier, not the exact length, so patterns sharing a tier share the type.
 

Additional Inherited Members

- Public Member Functions inherited from real::detail::basic_pike_state< basic_thread_list< static_vec< std::int32_t, CodeSize >, static_vec< std::size_t, CodeSize >, static_vec< std::uint64_t, CodeSize > >, static_vec< eps_entry,(3 *CodeSize)+4 > >
constexpr basic_pike_state () noexcept
 Value-initializes table and cp_page during constant evaluation only.
 

Detailed Description

template<std::size_t CodeSize, std::size_t SlotCount, bool WantsIL>
struct real::detail::static_pike_scratch< CodeSize, SlotCount, WantsIL >

Compile-time-storage VM scratch, all fixed-capacity (zero heap), keyed on DIMENSIONS ONLY.

The epsilon DFS stack is bounded because each pc is processed once and pushes at most two explore entries plus one restore entry. Capture slots live in a copy-on-write basic_capture_pool (a thread carries one block index, not a slot run), sized for the worst-case block count — the same zero-heap, compile-sized discipline.

Note
Deliberately parameterised on sizes rather than on the pattern, so two patterns of the same shape can share one instantiation. Anything that depends on the pattern's value belongs in the thin per-pattern type deriving from this, not here — see 10.1 The inlining budget for what the distinction costs when it is not maintained.
Template Parameters
CodeSizeScratch capacity in instructions — a TIER (see scratch_code_tier), not the exact program length, so neighbouring shapes share one instantiation.
SlotCountCapture slots.
WantsILWhether the inner-literal route is compiled in.

The documentation for this struct was generated from the following file: