summaryrefslogtreecommitdiff
path: root/src/regex_impl.hh
diff options
context:
space:
mode:
authorMaxime Coste <mawww@kakoune.org>2025-07-08 11:43:17 +1000
committerMaxime Coste <mawww@kakoune.org>2025-07-08 12:07:33 +1000
commitce1d512a0c1922ab5f43f28e7bae573508c98601 (patch)
tree7af8effd6b00c304cda1c87f657a0014fcdae2ae /src/regex_impl.hh
parentfea08fc18d268ace4f843ec2b57cc33e36562098 (diff)
Replace std::unique_ptr with a custom implementation
<memory> is a costly header we can avoid by just implementing UniquePtr ourselves, which is a pretty straightforward in modern C++, this saves around 10% of the compilation time here.
Diffstat (limited to 'src/regex_impl.hh')
-rw-r--r--src/regex_impl.hh6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/regex_impl.hh b/src/regex_impl.hh
index 8853ced5..d62261ec 100644
--- a/src/regex_impl.hh
+++ b/src/regex_impl.hh
@@ -169,8 +169,8 @@ struct CompiledRegex : UseMemoryDomain<MemoryDomain::Regex>
bool map[count];
};
- std::unique_ptr<StartDesc> forward_start_desc;
- std::unique_ptr<StartDesc> backward_start_desc;
+ UniquePtr<StartDesc> forward_start_desc;
+ UniquePtr<StartDesc> backward_start_desc;
};
String dump_regex(const CompiledRegex& program);
@@ -751,7 +751,7 @@ private:
return res;
}
- std::unique_ptr<Thread[]> m_data;
+ UniquePtr<Thread[]> m_data;
uint32_t m_capacity_mask = 0; // Maximum capacity should be 2*instruction count, so 65536
uint32_t m_current = 0;
uint32_t m_next_begin = 0;