From 5e5933256b022f6890fc3f14164ae9e9c3ee9ae3 Mon Sep 17 00:00:00 2001 From: bunnei Date: Sat, 3 Apr 2021 21:21:22 -0700 Subject: hle: kernel: Refactor IPC interfaces to not use std::shared_ptr. --- src/core/hle/kernel/hle_ipc.h | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'src/core/hle/kernel/hle_ipc.h') diff --git a/src/core/hle/kernel/hle_ipc.h b/src/core/hle/kernel/hle_ipc.h index 398f1c467..74a95bc76 100644 --- a/src/core/hle/kernel/hle_ipc.h +++ b/src/core/hle/kernel/hle_ipc.h @@ -39,6 +39,7 @@ class HandleTable; class HLERequestContext; class KernelCore; class Process; +class ClientSession; class ServerSession; class KThread; class KReadableEvent; @@ -71,7 +72,8 @@ public: * associated ServerSession alive for the duration of the connection. * @param server_session Owning pointer to the ServerSession associated with the connection. */ - void ClientConnected(std::shared_ptr server_session); + void ClientConnected( + std::shared_ptr client_session, std::shared_ptr server_session); /** * Signals that a client has just disconnected from this HLE handler and releases the @@ -84,7 +86,8 @@ protected: /// List of sessions that are connected to this handler. /// A ServerSession whose server endpoint is an HLE implementation is kept alive by this list /// for the duration of the connection. - std::vector> connected_sessions; + std::vector> client_sessions; + std::vector> server_sessions; }; /** @@ -218,21 +221,21 @@ public: } template - std::shared_ptr GetCopyObject(std::size_t index) { + T* GetCopyObject(std::size_t index) { return DynamicObjectCast(copy_objects.at(index)); } template - std::shared_ptr GetMoveObject(std::size_t index) { + T* GetMoveObject(std::size_t index) { return DynamicObjectCast(move_objects.at(index)); } - void AddMoveObject(std::shared_ptr object) { - move_objects.emplace_back(std::move(object)); + void AddMoveObject(Object* object) { + move_objects.emplace_back(object); } - void AddCopyObject(std::shared_ptr object) { - copy_objects.emplace_back(std::move(object)); + void AddCopyObject(Object* object) { + copy_objects.emplace_back(object); } void AddDomainObject(std::shared_ptr object) { -- cgit v1.2.3