diff options
| author | Maxime Coste <mawww@kakoune.org> | 2025-07-08 11:43:17 +1000 |
|---|---|---|
| committer | Maxime Coste <mawww@kakoune.org> | 2025-07-08 12:07:33 +1000 |
| commit | ce1d512a0c1922ab5f43f28e7bae573508c98601 (patch) | |
| tree | 7af8effd6b00c304cda1c87f657a0014fcdae2ae /src/hook_manager.hh | |
| parent | fea08fc18d268ace4f843ec2b57cc33e36562098 (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/hook_manager.hh')
| -rw-r--r-- | src/hook_manager.hh | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/hook_manager.hh b/src/hook_manager.hh index 97c768a3..f0b66c71 100644 --- a/src/hook_manager.hh +++ b/src/hook_manager.hh @@ -6,8 +6,7 @@ #include "meta.hh" #include "enum.hh" #include "array.hh" - -#include <memory> +#include "unique_ptr.hh" namespace Kakoune { @@ -141,10 +140,10 @@ private: friend class Scope; SafePtr<HookManager> m_parent; - Array<Vector<std::unique_ptr<HookData>, MemoryDomain::Hooks>, enum_desc(Meta::Type<Hook>{}).size()> m_hooks; + Array<Vector<UniquePtr<HookData>, MemoryDomain::Hooks>, enum_desc(Meta::Type<Hook>{}).size()> m_hooks; mutable Vector<std::pair<Hook, StringView>, MemoryDomain::Hooks> m_running_hooks; - mutable Vector<std::unique_ptr<HookData>, MemoryDomain::Hooks> m_hooks_trash; + mutable Vector<UniquePtr<HookData>, MemoryDomain::Hooks> m_hooks_trash; }; } |
