From 6187de7ca7a24dd521fad517d857c6318bc8075f Mon Sep 17 00:00:00 2001 From: Lioncash Date: Thu, 23 May 2019 22:08:25 -0400 Subject: [PATCH] a32_interface: std::move UserConfig where applicable UserConfig instances contain up to 16 std::shared_ptr instances. We can std::move here to avoid performing 16 redundant atomic reference increment and decrement operations. Mostly inconsequential on x64, but we may as well signify intent. --- src/backend/x64/a32_interface.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/backend/x64/a32_interface.cpp b/src/backend/x64/a32_interface.cpp index 5e384632..a8b0fff9 100644 --- a/src/backend/x64/a32_interface.cpp +++ b/src/backend/x64/a32_interface.cpp @@ -42,7 +42,7 @@ struct Jit::Impl { Impl(Jit* jit, A32::UserConfig config) : block_of_code(GenRunCodeCallbacks(config.callbacks, &GetCurrentBlock, this), JitStateInfo{jit_state}) , emitter(block_of_code, config, jit) - , config(config) + , config(std::move(config)) , jit_interface(jit) {} @@ -142,7 +142,7 @@ private: } }; -Jit::Jit(UserConfig config) : impl(std::make_unique(this, config)) {} +Jit::Jit(UserConfig config) : impl(std::make_unique(this, std::move(config))) {} Jit::~Jit() = default;