From f10eb9faa30428172033a4e4e689a76b7b0510c2 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Fri, 27 Apr 2018 08:18:04 +1000 Subject: Use indices instead of pointers for saves/instruction in ThreadedRegexVM Performance seems unaffacted, but memory usage should be lowered as the Thread struct is 4 bytes instead of 16. --- src/regex_impl.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/regex_impl.cc') diff --git a/src/regex_impl.cc b/src/regex_impl.cc index bf32cde2..0202cb85 100644 --- a/src/regex_impl.cc +++ b/src/regex_impl.cc @@ -551,7 +551,7 @@ private: NodeIndex new_node(ParsedRegex::Op op, Codepoint value = -1, ParsedRegex::Quantifier quantifier = {ParsedRegex::Quantifier::One}) { - constexpr auto max_nodes = std::numeric_limits::max(); + constexpr auto max_nodes = std::numeric_limits::max(); const NodeIndex res = m_parsed_regex.nodes.size(); if (res == max_nodes) parse_error(format("regex parsed to more than {} ast nodes", max_nodes)); @@ -837,7 +837,7 @@ private: uint32_t push_inst(CompiledRegex::Op op, uint32_t param = 0) { - constexpr auto max_instructions = std::numeric_limits::max(); + constexpr auto max_instructions = std::numeric_limits::max(); const uint32_t res = m_program.instructions.size(); if (res > max_instructions) throw regex_error(format("regex compiled to more than {} instructions", max_instructions)); -- cgit v1.2.3