summaryrefslogtreecommitdiff
path: root/src/buffer_manager.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/buffer_manager.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/buffer_manager.hh')
-rw-r--r--src/buffer_manager.hh5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/buffer_manager.hh b/src/buffer_manager.hh
index 2b4c0b31..f441aa9b 100644
--- a/src/buffer_manager.hh
+++ b/src/buffer_manager.hh
@@ -4,8 +4,7 @@
#include "buffer.hh"
#include "vector.hh"
#include "utils.hh"
-
-#include <memory>
+#include "unique_ptr.hh"
namespace Kakoune
{
@@ -13,7 +12,7 @@ namespace Kakoune
class BufferManager : public Singleton<BufferManager>
{
public:
- using BufferList = Vector<std::unique_ptr<Buffer>, MemoryDomain::BufferMeta>;
+ using BufferList = Vector<UniquePtr<Buffer>, MemoryDomain::BufferMeta>;
using iterator = BufferList::const_iterator;
~BufferManager();