diff options
author | bunnei <bunneidev@gmail.com> | 2020-02-09 03:35:30 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-09 03:35:30 +0100 |
commit | a952fbc5b385fb133ad7534c8defc128878bb1dc (patch) | |
tree | 7db0d70ce406acecedafa3e72ac9e1340f20761e /src/core/hle/service/am/applets/applets.cpp | |
parent | Merge pull request #3387 from bunnei/gpu-mpscqueue (diff) | |
parent | hle: services: Use std::shared_ptr instead of copy by value. (diff) | |
download | yuzu-a952fbc5b385fb133ad7534c8defc128878bb1dc.tar yuzu-a952fbc5b385fb133ad7534c8defc128878bb1dc.tar.gz yuzu-a952fbc5b385fb133ad7534c8defc128878bb1dc.tar.bz2 yuzu-a952fbc5b385fb133ad7534c8defc128878bb1dc.tar.lz yuzu-a952fbc5b385fb133ad7534c8defc128878bb1dc.tar.xz yuzu-a952fbc5b385fb133ad7534c8defc128878bb1dc.tar.zst yuzu-a952fbc5b385fb133ad7534c8defc128878bb1dc.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/hle/service/am/applets/applets.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/core/hle/service/am/applets/applets.cpp b/src/core/hle/service/am/applets/applets.cpp index 3e97ba218..c3261f3e6 100644 --- a/src/core/hle/service/am/applets/applets.cpp +++ b/src/core/hle/service/am/applets/applets.cpp @@ -50,7 +50,7 @@ AppletDataBroker::RawChannelData AppletDataBroker::PeekDataToAppletForDebug() co return {std::move(out_normal), std::move(out_interactive)}; } -std::unique_ptr<IStorage> AppletDataBroker::PopNormalDataToGame() { +std::shared_ptr<IStorage> AppletDataBroker::PopNormalDataToGame() { if (out_channel.empty()) return nullptr; @@ -60,7 +60,7 @@ std::unique_ptr<IStorage> AppletDataBroker::PopNormalDataToGame() { return out; } -std::unique_ptr<IStorage> AppletDataBroker::PopNormalDataToApplet() { +std::shared_ptr<IStorage> AppletDataBroker::PopNormalDataToApplet() { if (in_channel.empty()) return nullptr; @@ -69,7 +69,7 @@ std::unique_ptr<IStorage> AppletDataBroker::PopNormalDataToApplet() { return out; } -std::unique_ptr<IStorage> AppletDataBroker::PopInteractiveDataToGame() { +std::shared_ptr<IStorage> AppletDataBroker::PopInteractiveDataToGame() { if (out_interactive_channel.empty()) return nullptr; @@ -79,7 +79,7 @@ std::unique_ptr<IStorage> AppletDataBroker::PopInteractiveDataToGame() { return out; } -std::unique_ptr<IStorage> AppletDataBroker::PopInteractiveDataToApplet() { +std::shared_ptr<IStorage> AppletDataBroker::PopInteractiveDataToApplet() { if (in_interactive_channel.empty()) return nullptr; @@ -88,21 +88,21 @@ std::unique_ptr<IStorage> AppletDataBroker::PopInteractiveDataToApplet() { return out; } -void AppletDataBroker::PushNormalDataFromGame(IStorage storage) { - in_channel.push_back(std::make_unique<IStorage>(storage)); +void AppletDataBroker::PushNormalDataFromGame(std::shared_ptr<IStorage>&& storage) { + in_channel.emplace_back(std::move(storage)); } -void AppletDataBroker::PushNormalDataFromApplet(IStorage storage) { - out_channel.push_back(std::make_unique<IStorage>(storage)); +void AppletDataBroker::PushNormalDataFromApplet(std::shared_ptr<IStorage>&& storage) { + out_channel.emplace_back(std::move(storage)); pop_out_data_event.writable->Signal(); } -void AppletDataBroker::PushInteractiveDataFromGame(IStorage storage) { - in_interactive_channel.push_back(std::make_unique<IStorage>(storage)); +void AppletDataBroker::PushInteractiveDataFromGame(std::shared_ptr<IStorage>&& storage) { + in_interactive_channel.emplace_back(std::move(storage)); } -void AppletDataBroker::PushInteractiveDataFromApplet(IStorage storage) { - out_interactive_channel.push_back(std::make_unique<IStorage>(storage)); +void AppletDataBroker::PushInteractiveDataFromApplet(std::shared_ptr<IStorage>&& storage) { + out_interactive_channel.emplace_back(std::move(storage)); pop_interactive_out_data_event.writable->Signal(); } |