summaryrefslogtreecommitdiff
path: root/src/remote.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/remote.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/remote.hh')
-rw-r--r--src/remote.hh13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/remote.hh b/src/remote.hh
index dc6bc41f..40d0367e 100644
--- a/src/remote.hh
+++ b/src/remote.hh
@@ -6,8 +6,7 @@
#include "utils.hh"
#include "vector.hh"
#include "optional.hh"
-
-#include <memory>
+#include "unique_ptr.hh"
namespace Kakoune
{
@@ -30,15 +29,15 @@ using RemoteBuffer = Vector<char, MemoryDomain::Remote>;
class RemoteClient
{
public:
- RemoteClient(StringView session, StringView name, std::unique_ptr<UserInterface>&& ui,
+ RemoteClient(StringView session, StringView name, UniquePtr<UserInterface>&& ui,
int pid, const EnvVarMap& env_vars, StringView init_command,
Optional<BufferCoord> init_coord, Optional<int> stdin_fd);
bool is_ui_ok() const;
const Optional<int>& exit_status() const { return m_exit_status; }
private:
- std::unique_ptr<UserInterface> m_ui;
- std::unique_ptr<FDWatcher> m_socket_watcher;
+ UniquePtr<UserInterface> m_ui;
+ UniquePtr<FDWatcher> m_socket_watcher;
RemoteBuffer m_send_buffer;
Optional<int> m_exit_status;
};
@@ -68,8 +67,8 @@ private:
String m_session;
bool m_is_daemon;
- std::unique_ptr<FDWatcher> m_listener;
- Vector<std::unique_ptr<Accepter>, MemoryDomain::Remote> m_accepters;
+ UniquePtr<FDWatcher> m_listener;
+ Vector<UniquePtr<Accepter>, MemoryDomain::Remote> m_accepters;
};
bool check_session(StringView session);