1
0
Fork 0
mirror of https://github.com/LadybirdBrowser/ladybird.git synced 2025-06-08 13:37:10 +09:00

LibRegex: Move StringTable ctor/dtor out of line

This also moves the next_serial class static into a file scope static.
The public class static was causing visibility issues with certain Linux
builds when hidden visibility was enabled. However, the current design
makes more sense anyway :^).
This commit is contained in:
Andrew Kaster 2025-05-11 23:17:29 -06:00 committed by Andrew Kaster
parent 8f670950e2
commit 3dd2fbd041
Notes: github-actions[bot] 2025-05-12 09:23:38 +00:00
2 changed files with 14 additions and 13 deletions

View file

@ -161,7 +161,18 @@ static bool restore_string_position(MatchInput const& input, MatchState& state)
OwnPtr<OpCode> ByteCode::s_opcodes[(size_t)OpCodeId::Last + 1];
bool ByteCode::s_opcodes_initialized { false };
size_t ByteCode::s_next_checkpoint_serial_id { 0 };
u32 StringTable::next_serial { 0 };
static u32 s_next_string_table_serial { 0 };
StringTable::StringTable()
: m_serial(s_next_string_table_serial++)
{
}
StringTable::~StringTable()
{
if (m_serial == s_next_string_table_serial - 1 && m_table.is_empty())
--s_next_string_table_serial; // We didn't use this serial, put it back.
}
void ByteCode::ensure_opcodes_initialized()
{